Hi David,

David Nolen wrote:
> So my Java ignorance once again rears it's ugly head. It turns out
> that JNI dynamic libs can't really be part of a .jar.

I can't say I know much about JNI but I've used some libraries like
SQLiteJDBC and Qt Jambi which bundle the native libraries in the jar, so
the consumer of the library can use them just as if they were normal
java libraries, which is very convenient.  Looking at the source code to
SQLiteJDBC it looks like what they do is check the platform with
(System/getPropertly "os.name") and then copy the appropriate lib files
(extracted from the jar with getResourceAsStream) to /tmp (just using
java.io.File/createTempFile) and then call System/load on them.

> The problem is that JOGL needs JNIs and JNIs need to be on
> java.library.path or java.ext.dirs, not the classpath. In order to
> make life easier for people learning about clojure as well generally
> making lein projects simpler to play around for newbies do people see
> any utility in supporting something like lein run?

I'm a little unclear about what are you proposing "lein run" would 
actually do for JNI stuff.  Something like this?

java -cp 'src:classes:lib/*' -Djava.library.path=native-lib/ \
      clojure.main -i src/gears.clj -e "(gears/-main)"

What would it set java.library.path to?  Or are suggesting that would be 
configurable in the project.clj?

Cheers,

Alex

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to