[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

JNI Installation Directories



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi.  I'd like to make two proposals regarding JNI that I'd like to see in java 
policy.

1) Common JNI library directory:

I'd like to see all JNI modules, i.e., the C libraries that implement the 
native Java methods, placed in /usr/lib/jni/.  I believe it would be nice to 
centralise their location the same way that Java classes are all placed in 
jars in /usr/share/java/.

2) I'd like to see policy require that all Java virtual machines include 
/usr/lib/jni/ in their default library search path.  Currently the library 
search path has to be specified on the command-line with 
- -Djava.library.path=/usr/lib/jni or whatever.  But to actually use the JNI 
classes, you already need to explicitly include /usr/share/java/foo.jar in 
your classpath and the Java classes then specify which C library to open, so 
I see no need to have to explicitly specify the C library search path as 
well.

I realise (2) is a tall order for JVM maintainers, but I believe it will make 
things somewhat more sane in the long run for apps or libraries that use JNI 
classes.  Consider writing a Java program that uses library X which uses 
library Y which has JNI methods; then (in the current setup) the startup 
script for this Java program has to keep track of where library Y places its 
C library and must add a corresponding -Djava.library.path= argument to its 
java invocation.  I'd like to get rid of that all together and just require 
the startup script to add libX.jar and libY.jar to the classpath, end of 
story.

Presumably (2) could (if desired) be implemented in a wrapper script, similar 
to what gij-wrapper-3.2 provides at the moment, and this wrapper script is 
then what's actually offered as the /usr/bin/java alternative.

Note that this wrapper script would need to see if any -Djava.library.path 
arguments are *already* being passed and if so then simply augment that list 
with /usr/lib/jni.

Thoughts?

Ben.

- -- 

Ben Burton
benb@acm.org  |  bab@debian.org
Public Key: finger bab@db.debian.org

I started finding the people inside me; the prostitute that's really
angry because I judged her so harshly, the self-righteous virgin who knows
everything about sex and has never made love.
	- Tori Amos

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE9niKbMQNuxza4YcERAojzAJwPCVael6CTuoPk1PkTRh7yWDawDgCdGHhc
PPihaQ4YqshVjmTZxJEvZpw=
=c2OF
-----END PGP SIGNATURE-----



Reply to: