Setting the path to native libraries in V4.0 releases
 Technote (FAQ)
 
Problem
This technote provides instructions for setting paths to native libraries. This can be accomplished by setting an operating system environment variable or by setting a JVM™ system property. You can receive a java.lang UnsatisfiedLinkError from any application if the native library required by the application is not found in the library path.
 
Cause
An improperly set path to native libraries. To work properly, the application requires that the native libraries be in the library path.
 
Solution
To set the path to a native library, you can use an operating system environment variable or you can set a JVM system property. If this path is not properly defined, an Unsatisfied Link error can occur when a Java™ program makes a native call but is unable to find the native library.

A. Setting the Operating System environment variable


Each operating system has a different name for the environment variable to include native libraries in your path.
  • AIX = LIBPATH

  • Linux = LD_LIBRARY_PATH

  • Solaris = LD_LIBRARY_PATH

  • HP-UX = SHLIB_PATH

  • Windows = PATH

Set the proper environment variable path on Unix® platforms by editing the WebSphere® startup script as follows:

  1. Open the startupServer.sh script found in WebSphere\AppServer\bin

  2. Append to the path, adding the path to the shared library required by the application.

    Note: There are two places where this environment variable is set. In this script, there is an IF ELSE statement, which depends on the database that you are using. If your repository is hosted on DB2, append it to that statement. If you are not using DB2 for the repository, append it to the path statement under the ELSE:

    For example, on AIX do the following:

    LIBPATH=$WAS_HOME/bin:$WAS_HOME/lib:/my_shared_libraries:$LIBPATH

  3. Save the changes

  4. Restart WebSphere Application Server.

Modify the PATH variable on Windows® platforms as follows:

  1. Right-click on My Computer

  2. Click on Properties.

  3. Click the Advanced tab.

  4. Click Environment Variables.

  5. In the System Variables section, scroll to the entry for Path, select it, and click Edit.

  6. Add the path to your *.dll files. The filename of the .dll is not needed. Only the path to the .dll must be entered (see screenshot below).



  7. Click OK on this and the next two windows.

  8. Restart WebSphere Application Server.


Set the operating system environment variables through the WebSphere Application Server Administrative Console:
  1. In the Administrative Console, select the application server for which you want to configure the environment variables.

  2. Click on the General tab.

  3. Click Environment (see screenshot below).



  4. In the Environment Editor window, click Add, then type the Name and Value for your environment variables (see screenshot below):



  5. Click OK.

  6. Click Apply.

  7. Restart WebSphere Application Server.

B. Setting the java.library.path JVM system property


To set the java.library.path for all Operating Systems:
  1. Open the Administrative Console.

  2. Navigate to the Application Server (JVM)for which you want to add the classpath.

  3. Click on the JVM Settings tab.

  4. In the System Properties section click Add.

  5. Type the java.library.path for the Name, then type the path to the library for the Value.
  6. Click Apply.

  7. Restart the WebSphere Application Server.


 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Classloader
Operating system(s): HP-UX
Software version: 4.0.7
Software edition:
Reference #: 1164753
IBM Group: Software Group
Modified date: Mar 31, 2004