Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43963 - missing infrastructure for installing the native part of a java package
Summary: missing infrastructure for installing the native part of a java package
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 31468
  Show dependency tree
 
Reported: 2004-03-07 09:16 UTC by Robert Schuster
Modified: 2004-12-23 02:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schuster 2004-03-07 09:16:32 UTC
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.
Comment 1 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-06-02 13:18:53 UTC
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:/
Comment 2 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-12-23 02:08:22 UTC
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