Java Tutorial/Development/JNI

Материал из Java эксперт
Перейти к: навигация, поиск

If the DLL is in the CLASSPATH then you don"t need to specify a PATH.

   <source lang="java">

Runtime.getRuntime().load("d:/directoryX/subDirY/MyDll.dll");</source>





Load a DLL

   <source lang="java">

System.loadLibrary("d:\\directoryX\\subDirY\\MyDll.dll")</source>





Specify through the JVM command line the location where to find the JNI DLL to be loaded

   <source lang="java">

java -Djava.library.path=c:/JNI</source>