tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: JNI in Tomcat6
Date Wed, 02 May 2007 18:09:30 GMT
> From: Martin Gainty [] 
> Subject: Re: JNI in Tomcat6
> usually the binaries are located in %JAVA_HOME%/jre/bin

Only DLLs that are part of the JVM should be placed in
%JAVA_HOME%/jre/bin; this is not an appropriate location for
application-specific native code.

> change LD_LIBRARY_PATH in jvm.cfg to point to the folder 
> containing your DLL

You can't set LD_LIBRARY_PATH in jvm.cfg (at least not in the one in
%JAVA_HOME%/jre/lib/[arch] for a Sun-based JVM; I know of no other
locations for jvm.cfg).  The jvm.cfg file is only for configuring which
JVMs are available (just client and server, these days).  The jvm.cfg
mechanism is expected to disappear when the client and server JVMs are
finally integrated into a single JVM.  (If you want to see how jvm.cfg
is processed, set the env var _JAVA_LAUNCHER_DEBUG to any value when you
start the JVM from a command prompt.)

Now back to Christian's original question:

> Where do i have to place the DLL File, that the 
> Classloader will find it?

The JVM finds native libraries by looking at the system property
java.library.path.  On Windows, the default value of this property is
taken from the PATH environment variable, prefixed with a few
directories the JVM launcher knows about (e.g., C:\WINDOWS\system32).
The LD_LIBRARY_PATH environment variable is not used at all on Windows.

On Linux/UNIX systems, the default java.library.path includes various
directories from the JVM installation plus a few standard locations.
For example, on one of our SUSE boxes, it's:


On Linux/UNIX, the LD_LIBRARY_PATH environment variable can be used to
modify the above list; whatever is specfied with that variable is
inserted in the list just prior to the first /usr entry.

The default value can be overridden by specifying
-Djava.library.path=<whatever> on the command line for any platform.  If
Tomcat is running as a Windows service, you can use the tomcat?w.exe
utility to set whatever value you want for the java.library.path
property.  On a running Tomcat, use the System Information -> System
Properties screen of Lambda Probe ( to display all
of the property names and values.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message