error with System.loadLibrary(...) with java.library.path set
807580Jan 11 2010 — edited Jan 16 2010I'm trying to get my feet wet with JavaMonkeyEngine using netbeans (on Windows XP SP3, Java 1.6).
When I try to run a simple example program, I'm getting
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl.dll in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
My runtime arguments include: -Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/:etc
I'm pretty sure that the path is correct, because I tried the following code:
String [] dirs = System.getProperties().getProperty("java.library.path").split(":");
for(int i = 0; i < dirs.length; i++ ){
String path = dirs[i] + java.io.File.separatorChar + "lwjgl.dll";
if( (new java.io.File(path)).exists()) {
System.out.println("found in dir " + dirs);
path = (new java.io.File(path)).getAbsolutePath();
System.load(path);
System.out.println("was able to load library manually");
}
}
and the System.load method was reached and didn't throw an exception.
However, the below call does throw an exception.
System.loadLibrary("lwjgl.dll");
Presumably, I shouldn't need to put the dlls into my Path (otherwise whats the purpose of the -D argument).
I would appreciate some brilliant illuminating thought about now, something like "you forgot the magical snafu parameter" or such.
Thanks in advance.
Eric.