I found out that there is currently no way to handle the installation of the native part of a java package. The followings things are required from a JVMs perspective: a) the java part of the library has to be in classpath This can be done with the java-eclass and the help of java-config. no problem here. b) the native part has to be available through the path specified by the system property java.library.path On linux the simplest way of doing this would be adding the directory which contains the shared libraries to the enviromnent variable LD_LIBRARY_PATH. However I suggest the addition of a specialized java library directory which is always mentioned in LD_LIBRARY_PATH and to which java-config generates symlinks when adding a specific system via the -B or -b option. In java-pkg.eclass a function has to be added that acts like dojar but for the shared libraries. Well another possibility to install a native library is to copy the files into ${JAVA_HOME}/jre/lib/i386 but this would be a bad solution. Think of the problems when installing multiple JDKs (often on developer machines). I have taken a look java-gnome which contains such a native library. It uses the current value of ${JAVA_HOME} and installs the library into /usr/lib. This is bad because it is bypassing java-config and second /usr/lib is only made available to the JRE which was active when installing. Reproducible: Always Steps to Reproduce: Try installing a java package which contains a native library and expect it to be manageable with java-config as every other java package. Expected Results: java package with native libraries should be manageable by java-config: * support multiple jvms * activate/passivate after installation * have installation functions ready (like dojar) I filed this as major because this isn't a usual bug. A whole infrastructure to handle java native libraries is missing.
We've been revamping the handling of jar files in Gentoo, and this will also require proper attention. This, sadly, is a very time-consuming project:/
We now have a system for this. It's rather simple, and can hopefully remain so. Java ebuilds just use the java-pkg_doso for its .so files. Afterwards, the startup script must add -Djava.library.path=/usr/lib, and it just works(tm). We may need to extend this in the future. And it's somewhat of a hassle for libraries, but we've not been able to figure out working, JDK-independent solution that's transparent. I.e. javac -cp `java-config -p swt-3`:. MySWTApp.java ; java -cp `java-config -p swt-3` MySWTApp would be nice, but for now, java -Djava.library.path=/usr/lib -cp `java-config -p swt-3` MySWTApp