The JavaTM Tutorial
Previous Page Lesson Contents Start of Tutorial > Start of Trail > Start of Lesson Search

Trail: Java Native Interface
Lesson: Writing a Java Program with Native Methods

Set Your Library Path

UNIX
% setenv LD_LIBRARY_PATH mylibrarypath
where mylibrarypath is the name of the directory that contains libhello.so.

DOS shell (Windows 95/NT)
On Windows 95/NT, the loadLibrary() method searches for DLLs in the same manner as other language environments do.

MacOS
The Java runtime searches the JavaSoft Folder in the Extensions folder in the System Folder for shared libraries. Create an alias to your shared library in the JavaSoft Folder.

Previous Page Lesson Contents Start of Tutorial > Start of Trail > Start of Lesson Search