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:
- Open the startupServer.sh script found in WebSphere\AppServer\bin
- 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
- Save the changes
- Restart WebSphere Application Server.
Modify the PATH variable on Windows® platforms as follows:
- Right-click on My Computer
- Click on Properties.
- Click the Advanced tab.
- Click Environment Variables.
- In the System Variables section, scroll to the entry for
Path, select it, and click Edit.
- 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).
- Click OK on this and the next two windows.
- Restart WebSphere Application Server.
Set the operating system environment variables through the WebSphere
Application Server Administrative Console:
- In the Administrative Console, select the application server for which
you want to configure the environment variables.
- Click on the General tab.
- Click Environment (see screenshot below).
- In the Environment Editor window, click Add, then type
the Name and Value for your environment variables (see
screenshot below):
- Click OK.
- Click Apply.
- Restart WebSphere Application Server.
B. Setting the java.library.path JVM system property
To set the java.library.path for all Operating Systems:
- Open the Administrative Console.
- Navigate to the Application Server (JVM)for which you want to add the
classpath.
- Click on the JVM Settings tab.
- In the System Properties section click Add.
- Type the java.library.path for the Name, then type the path to
the library for the Value.
- Click Apply.
- Restart the WebSphere Application Server.

|