My situation was a bit complicated. I had to take three steps since I used .dll in the resource directory for JNI code. My files were
S:\Accessibility\tools\src\main\resources\dlls\HelloWorld.dll S:\Accessibility\tools\src\test\java\com\accessibility\HelloWorld.class
My code contained the following line
System.load(HelloWorld.class.getResource("/dlls/HelloWorld.dll").getPath());
First, I had to move to the route directory
cd /D "S:\Accessibility\tools\src\test\java"
Then I had to change the class path to point to the current directory so that my class was loaded, and I had to change the class path to point to its resource directory so that my DLL was loaded.
set classpath=%classpath%;.;..\..\..\src\main\resources;
Then I had to run java using the class name.
java com.accessibility.HelloWorld
Scott Izu Aug 10 '13 at 1:30 2013-08-10 01:30
source share