beginner woes

Hi there,

I’m having trouble running the HelloXith3D example.

The example compiled fine with:

D:\xith>javac -classpath libs/xith3d.jar HelloXith3D.java

but I get this error when I try to run it:

D:\xith>java HelloXith3D
Exception in thread “main” java.lang.NoClassDefFoundError: HelloXith3D (wrong name: org/xith3d/gsg/HelloXith3D)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Having put the .jar’s and the .dll’s in the folders specified in the installation guide, for both of the java environments on this pc, I’m at a loss as to what I can do to fix it.

Any ideas?

Thanks in advance :slight_smile:

ps. Sorry if this question has been asked before.

pps. I’ve ran a few of the bundled test demos (CubeTest, Xith3DSphereMotionLightingTest) with no problems. Although I got null pointer exceptions for Xith3DAseTransformGroupTreeTest and Xith3DAseGroupTest - I don’t know if these errors are related to my main problem.

This is probably good question for the newless clubies category…

you need to run

java org.xith3d.gsg.HelloXith3D

HelloXith3D is in the org.xith3d.gsg package, so you must specify the package name, that’s why it’s saying you have the wrong name.

I probably should of mentioned that I’ve tried that already.

Anyways I was just following the instructions on the installation guide which stated that you should compile with: javac -classpath libs/xith3d.jar HelloXith3D.java

and run with: java HelloXith3D

so… yeah thx but thats not the solution :slight_smile:

[edit: corrected]

The tutorial reads:

Does that work?

It also talks about HelloXith3D when explaining how to compile your first program:

You need to download HelloXith3D.java!

http://xith.org/tutes/GettingStarted/examples/HelloXith3D/HelloXith3D.java

Now the second part is slightly incorrect - as “HelloXith3D” is in the org.xith3d.gsg package. I’ll fix it soon.

Cheers,

Will.

Ahh.

Great :slight_smile:

Thanks Will.

I’ve fixed up and organised the tute.

The dead link was fixed - and now the correct commands and examples are given.

Please tell me if there are still problems.

Note: be sure to refresh the page :slight_smile:

Cheers,

Will.