Trail: Java Native Interface
|
Lesson: Compiling and Running a Java Program with a Native Method
|
|
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.
|