Hi all this is my first post and I apologise if it is the wrong section. The title *sort of* says it all. I have googled my error but not been able to find any solutions and many results pointed to coderanch so I guess this is a good place .
I have the two files attached which will run up to the pop up of 4 on it's own.
The meh is the main class and it loads the DLLs via system.load and it also copies them if they don't exist (Although on my test machine I have downloaded the correct dlls from the j3d site as the ones I have packaged don't work at all.) That causes no problems.
The problem comes in the dr class. This class tries to display a simple universe but when I run the with "java -jar C:\test.jar" I get NoClassDefFound javax/media/j3d/Node. I don't understand it as I have set both the java.class and java.library paths to include where the files are copied to (Verified by JOptionPane.showMessageDialogs). I also try to load them through
Welcome to Java Ranch! You heard right, it is a good place.
Classpath issues are common in Java, and can be quite confusing. However, the solution is rarely to write your own class loader. What you want is to provide a complete class path to the java executable. Something like:
Each entry on the classpath should be either a directory that contains class files (in a folder tree replicating the package structure) or a jar file. You can set an environment variable CLASSPATH instead if you want
Beware that when you run your program with java -jar, you cannot specify the classpath with -cp or -classpath - it will simply be ignored when you use the -jar option. Also the CLASSPATH environment variable will be ignored when you run your program with the -jar option.