You need to make sure your DLL is in the classpath.
One way to do this is to specify the path to the DLL in the PATH environment variable.
Another option is to add it to the VM arguments in the LD_LIBRARY_PATH variable, for example:
java -Djava.library.path=/path/to/my/dll -cp /my/classpath/goes/here MainClass
If you are developing a complex application that needs to be stable, you need to make sure that the necessary DLL is somewhere somewhere where the OS will look for it, perhaps it will think about the script / program installer.
source share