Fork me on GitHub

Trying to duplicate this java call in lein---so, get lein's benefits re dependencies and running under CIDER (in Emacs). I gather boot is a viable alternative, and I'd consider trying that if lein's just not capable. java -classpath C:\Users\Schrag\.m2\repository\org\clojure\clojure\1.8.0\clojure-1.8.0.jar;c:\NeticaJ_Win\NeticaJ_504\bin\NeticaJ.jar -Djava.library.path=c:\NeticaJ_Win\NeticaJ_504\bin clojure.main Launching as above, this call works.

user=> (norsys.netica.Environ. nil)
#object[norsys.netica.Environ 0x6ca18a14 "norsys.netica.Environ@6ca18a14"]
With these lein defproject configuration clauses (also when omitting the Clojure JAR)...
:jvm-opts ["-Djava.library.path=c:/NeticaJ_Win/NeticaJ_504/bin/" ; NeticaJ.lib
             ;; Guessed this, project doesn't seem to launch with it: "-Ljava.library.path=c:/NeticaJ_Win/NeticaJ_504/bin"
  :resource-paths ["C:/Users/Schrag/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar;C:/NeticaJ_Win/NeticaJ_504/bin/NeticaJ.jar"]
...I get this error:
edit-server.core> (norsys.netica.Environ. nil)
UnsatisfiedLinkError C:\NeticaJ_Win\NeticaJ_504\bin\NeticaJ.dll: Can't find dependent libraries  java.lang.ClassLoader$NativeLibrary.load (
I've gotten some good help on this (today on #clojure) from @noisesmith, but we're stuck here. For context, I'm trying to port a third-party API to Clojure. API was originally written in C, vendor has packaged this as JNI, providing Java API. Vendor's java bin directory includes .jar, .dll, and .lib files. I am new to Clojure (longtime Common Lisper), have no real Java background. Using Windows. Ideas? Thanks...


try putting ^:replace between :jvm-opts and the vector after it


the default is to merge lein’s preferred opts in, that can lead to unexpected behavior if contradictory options are provided


I just noticed you turned the \ into / - was that because of quoting issues?


try just replacing each \ in the original with \\


if that’s the thing that did it, I’d consider that a lein bug maybe (I have seen errors in other clojure libs trying to be clever and use system.path_separator or whatever it is called when really windows is OK with either and then missing the real file path separator)


it’s “file.separator” I’m thinking of


lein interpreted "\Users" as \U (undefined) + "sers". Will try \\.


No change. I'm inclined to think / is ok, since it works everywhere else in defproject---e.g. :target-path.


And it's acting like it can find the class but can't traverse a link. So, at least one of those two clauses must be well-formed.