Re: Loading JNI

2011-01-06 Thread ax2groin
Sorry for the late response, but I haven't had time to play with things in a couple days. First discovery is that I probably cannot use the library path variable, because some of the DLLs have to be loaded in a specific order. Specifically, there is a "clientswig.dll" that has to be loaded last. G

Re: Loading JNI

2011-01-04 Thread George Jahad
> At this point I have ugly looking Clojure code that looks as >Java-like as possible, so that I'm doing the exact same thing in the >exact same order as I do in a Java example, but I get exceptions when >I do it in Clojure. if they are short enough, post both the working java and broken clojure

Re: Loading JNI

2011-01-04 Thread ax2groin
Thanks for the suggestions. I'll look at the JNA soon to see if that fits. But I already have working examples of Java code which uses the JNI wrapper classes (generated by swig - by someone else). I'm not making direct JNI calls myself, but trying to instantiate the Java classes that are a part of

Re: Loading JNI

2011-01-03 Thread Bill Robertson
I would suggest working through simple a example in just java, just so you can figure out how to get your dlls loaded and then calling them. Once you work out the configuration/setup kinks I would add clojure on top of that. I would also suggest you use jna instead of straight up jni. If it fits

Re: Loading JNI

2011-01-03 Thread .Bill Smith
As far as I know, Clojure doesn't talk straight JNI. In other words, there isn't a Clojure equivalent to the "native" keyword in Java. (If I'm mistaken about that, someone please speak up.) Nonetheless, Clojure *can* use native libraries. Your Clojure code can interact with a Java wrapper th

Re: Loading JNI

2011-01-03 Thread ax2groin
Of course not. I mentioned I'm new at this, right? It seems I was doing that part right before. I'm getting InvocationTargetException and NoClassDefFoundError, so I tried to work my way from the start to see if I was missing something (which I thought was a valid assumption, if exceptions were bei

Re: Loading JNI

2011-01-03 Thread .Bill Smith
Question about your really basic example: it looks as if it will print "Native code library failed to load" if System/load succeeds, and otherwise will print nothing at all. Is that what you intended? -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Loading JNI

2011-01-03 Thread ax2groin
Hmm, I see that the final draft of my question missed an essential element, I am using Eclipse. In any case, I've tried something really basic, and it fails: (try (System/load "C:\\app/bin/coms.dll") (println "Native code library failed to load.")) The file is there (I checked with an exists() c

Re: Loading JNI

2010-12-31 Thread dysinger
Msd, something like this java -Djava.library.path=/usr/local/lib -cp clojure-1.2.0.jar:src clojure.main or in lein add :native-path "/usr/local/lib:/usr/lib" to your project def then you should be able to make the JNI/JNA calls On Dec 31, 12:39 pm, ax2groin wrote: > I'm having trouble form

Loading JNI

2010-12-31 Thread ax2groin
I'm having trouble formulating a method to load JNI libraries into System. I'm just getting started, so this is a newbie question. I want something like this: (defn get-jni-path "Derive the path to DLLs from environmental variables" [] (let [path (System/getenv "APP_CONFIG_DIR")] (str (