Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

error with System.loadLibrary(...) with java.library.path set

807580Jan 11 2010 — edited Jan 16 2010
I'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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2010
Added on Jan 11 2010
9 comments
863 views