Fork me on GitHub

I want use -Jopt to add a jar file into classpath. what is the correct syntax looks like? clojure -J-cpjarpath ... seems to be no effect and clojure -J-cp jarpath ... will cause an error.

Alex Miller (Clojure team)14:05:07

clj builds the classpath so you must use your deps.edn for any modifications to the classpath. in this case, you'll want to use a local jar lib dependency - like my/lib {:local/root "/path/to.jar"}

Alex Miller (Clojure team)14:05:00

if you just want to add it sometimes, either put it in an alias with :extra-deps or declare it dynamically on the command line with -Sdeps


Getting this error running clojureL com.jcraft.jsch.agentproxy.AgentProxyException: connector is not available. This is on WSL running under Windows 10. Seem to recall having this issue before, but I don't remember the fix. git commands work fine, I recall this being something specific with the Java ssh implementation.


@seancorfield This was encountered while attempting to build an uberjar with depstar. Tried on Windows instead of WSL, where I get Exception in thread "main" java.nio.file.NoSuchFileException: C:\Users\dave\AppData\Local\Temp\uberjar8947452084826452117\uncomplicate\neanderthal\aux.clj, which seems weird, like there was a file in the manifest that didn't get copied.


@dave.dixon If you can repro easily, feel free to create an issue on GitHub with details and I'll take a look -- but I suspect something AOT-related


@dave.dixon Thanks for the repro case. It's definitely a weird one. Files/copy is failing on the target file during the copy which suggests the parent folder is missing (it isn't) or there is a permissions problem (there isn't). I've tried various changes to depstar locally but cannot figure out what the issue is.


Tracing through the JDK source, it seems to hinge on the last Windows filesystem error triggering an exception so I thought maybe it was a sync'ing issue -- but using SYNC or DSYNC for StandardOpenOption made no difference either.


I cloned and ran with :local/root and it works. :thinking_face:


Wait - never mind, I was commenting out the neanderthal dependency 😬 Been that kind of day.


@seancorfield If I exclude that file explicitly, it "works", in the sense of not throwing that exception. So it seems to be that single aux.clj file that's an issue.


And it gets weirder. So I modified depstar so that if a copy operation fails, it tries again, just copying the file to the top of the tree in the temp folders (so uncomplicate/neanderthal/aux.clj copies to thing.clj) and then it "succeeds" and copies the files that follow aux.clj in the Neanderthal JAR. However, I got a weird NoSuchFile exception trying to write test.jar after that (where it shouldn't matter if the file exists or not). I ran touch test.jar and re-ran the command -- and it worked just fine (with aux.clj copied to the top of the tree).