ClassNotFoundException

Discussion about Irrlicht's Java wrapper
Post Reply
dedea
Posts: 2
Joined: Tue Jun 24, 2008 8:26 pm

ClassNotFoundException

Post by dedea »

Hi there!

I'm getting the following error when running jirr files:

Exception in thread "main" java.lang.NoClassDefFoundError: TestHelloWorld
Caused by: java.lang.ClassNotFoundException: TestHelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

I've downloaded jirr source and bin files, and put them inside the same directory.

I'm using the following commands to compile the files:
javac -classpath ./lib/jirr131.jar TestHelloWorld.java

And running as folllows:
java -classpath ./lib/jirr131.jar TestHelloWorld

I'm using Ubuntu and Java 1.6.

Can anybody please, please, tell me what am I doing wrong? I've searched the forum, but found no usefull replies.

Thanks a lot!!!
dedea
Posts: 2
Joined: Tue Jun 24, 2008 8:26 pm

Post by dedea »

Hi,

I found out that was a ":" missing at:
java -classpath ./lib/jirr131.jar: TestHelloWorld

But now I'm getting:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no irrlicht_wrap in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at TestHelloWorld.<clinit>(TestHelloWorld.java:95)

I read at another post that it has to do with a missing directx dll, but it didn't worked out for me when I tried at WIndows. Does anyone knows how to solve it at linux?? Please!!
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

I don't know jirr, but I know enough Java. The error message says it all: You don't have the irrlicht_wrap.dll in your path. Either change the environment variable PATH so that it contains the directory the dll is in (you have to reopen the command window afterwards)
Alternatively you can set java.runtime.path in your java call.

Code: Select all

java -classpath ./lib/jirr131.jar: -Djava.library.path=/my/path/to/dll TestHelloWorld 
Post Reply