Cannot get ANY Java(3d,ogl) to work, errors

im new to the whole java3d / jogl / jsdl /lwjgl scene, and i am having alot of trouble just getting the demos to run.
My specs are

Gentoo linux 1.4
Athlon XP 2000+
nVidia geForce MX440

using the Netbeans IDE
j2sdk 1.4.2

at first i tried to get java3d working, it was packaged in a .bin installer file, so i did as the readme suggested and placed the installer in the j2sdk1.4.2 folder, then ran it, everything seemed to extract properly

i launched netbeans, browsed through the demos until i found the HelloUniverse demo, ran it, recieved the error:
Exception in thread “main” java.lang.NoClassDefFoundError: HelloUniverse

this had me puzzled, due to the fact that i had followed the readme precisely, i then went to console,

changed directory to my j2sdk/demo.java3d folder
java HelloUniverse

same error

i have also tried using JOGL and its respective demos with the same result

EDIT: i have just ensured that the path to the .jar files is included in my CLASSPATH

EDIT 2: Java Console Output

Exception in thread “main” java.lang.NoClassDefFoundError: demo/java3d/HelloUniverse/HelloUniverse (wrong name: HelloUniverse)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

If you look at the HelloUniverse source, theres no package. So you have to change to the HelloUniverse directory or make sure to have it in the classpath

thanks, that, seemed to work, it came up with a different error, which, i assume is because some .jar files arent where they should be

Exception in thread “main” java.lang.NoClassDefFoundError: javax/media/j3d/Node

i was browzing through the .jar files and although i can find a javax subdir, there is no media inside it

i am quite new to both java3d and java (been programming a fw months now), so any help would be appreciated

I cannot help in detail now, but it really seems to be a classpath problem.

Look for j3dcore.jar, j3dutil.jar and j3daudio.jar.
Normally they are located in the lib/ext directory somewhere in the JRE or JDK. They need to be found!

j3dcore contains that class you are currently missing.

Does look like a classpath problem, open the three jars Herk mentioned (j3dcore.jar, j3dutil.jar and j3daudio.jar) in the filesystems in netbeans to compile. I never managed to get 3d apps to work from netbeans well. Any apps that write to sysout slow down horrendously in most IDE’s i’ve tried (especially if it writes many debug messages per frame for example). I found the best thing to do was run it from an ant script and dump the output to log files.

HTH

Endolf

thank you for your continued persistance with my questions, now it can find the classes correctly, there is one more error that it is coming up with, i have no clue why this occurs:

Exception in thread “main” java.lang.NoClassDefFoundError: demo/java3d/HelloUniverse/HelloUniverse (wrong name: HelloUniverse)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

i have the jars mounted in netbeans, aswell as included in my class path

EDIT: i have been playing with jogl
when ever i goto run a jogl program the error
no jogl in java.library.path
is given, i assume that this means the jogl jar isnt in the library path, is this the same as CLASSPATH?

thanks in advance for your continued persistance

Still the same problem.

In NetBeans, make sure to mount the subdirectory demo/java3d/HelloUniverse as well and compile the class the from there! NetBeans takes the mountpoint as basis for the classpath!

thank you for your continued persistance, i didnt know that netbeans operated that way, i have it working now, thanks :slight_smile: