This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-30
Channels
- # aws (2)
- # beginners (139)
- # boot (9)
- # cider (1)
- # clara (2)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (112)
- # clojure-dusseldorf (9)
- # clojure-greece (6)
- # clojure-italy (13)
- # clojure-russia (160)
- # clojure-seattle-old (1)
- # clojure-uk (79)
- # clojurescript (85)
- # clojutre (1)
- # community-development (11)
- # core-async (32)
- # cryogen (2)
- # cursive (5)
- # data-science (16)
- # datomic (2)
- # events (1)
- # fulcro (29)
- # funcool (1)
- # graphql (4)
- # immutant (5)
- # instaparse (20)
- # jobs (2)
- # juxt (6)
- # leiningen (11)
- # luminus (21)
- # lumo (1)
- # off-topic (7)
- # onyx (20)
- # parinfer (33)
- # pedestal (4)
- # re-frame (41)
- # reagent (34)
- # ring-swagger (14)
- # rum (5)
- # spacemacs (9)
- # specter (11)
- # sql (14)
- # test-check (3)
- # yada (20)
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 (ClassLoader.java:-2)
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
@noisesmith Same error.
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