The java.library.path solution is not always good: there are many situations where you cannot change JVM parameters. The best solutions:
1) already mentioned: put the DLL in the same directory as the JAR, unfortunately, this makes using the JAR more difficult - now the JAR is not just a JAR, but has an accompanying DLL
2) put the DLL in the JAR as a regular resource, during the launch of the JAR, extract this DLL somewhere, for example. $ Tmp and then use System.load (new file (...)) as above. Then this JAR is just a JAR, users of this JAR may not even know that it uses any DLL
You can also use the Maven NAR plugin, which is powerful enough if you use Maven to build. See http://duns.github.com/maven-nar-plugin/
source share