Hacker News new | ask | show | jobs
by e12e 3969 days ago
I think clojure/lein really shows off the power of Maven/Ivy for managing packages. But I'm not sure how well that works for c++/c-extensions?

Pip does a remarkable job of magically getting and compiling missing c/c++ libraries, and works great in tandem with virtualenv.

1 comments

To this day I have not found a good way to distribute compiled JNI binaries. You can either consider them completely separate from your Java code and package them separately, or you can put them into your JAR and then do some horrible hacks of unpacking the JAR at runtime, detecting the architecture and loading the library from the temporary directory. This is really something that should be built into the standard package formats/tools.
Use https://github.com/fommil/jniloader - it's still the horrible hack under the hood, but it standardizes it all for you.