packaging native libraries

Johan Vos johan at
Fri Apr 19 00:16:54 PDT 2013


The javafxpackager is a great tool. I think it would actually make sense to
move some of the code (from src/com/sun/javafx/tools/packager) to the
javax. namespace and make it a public API, rather than having a single

But I have an issue: I need to bundle an external Java library, that also
comes with a native library. Bundling itself is not a problem with the
javafxpackager, and loading the native library is also achievable, by
unpacking the native lib, storing it in a temp file and loading it with
System.load(String). However, if the library is also loaded using
System.loadLibrary(String), the java.library.path is searched for the

One solution is that external Java libraries should not attempt to load the
native libraries themselves, rather rely on the developers to load the
libraries. But since in most cases you don't control these external
libraries, that will not work in all cases.

However, with a growing tendency towards bundled native applications, I
think the management of native dependencies is becoming more important.


- Johan

More information about the openjfx-dev mailing list