Problem with Xith3D install

Hi there… I guess that someone had this problem, but still I can’t solve it. So I’ll put here a list Of what I got and what I made so that you could help me.

OS Win XP Pro

java version “1.4.2”
Java™ 2 Runtime Environment, Standard Edition (build 1.4.2-b28 )
Java HotSpot™ Client VM (build 1.4.2-b28, mixed mode)

System Variables
JAVA_HOME = c:\j2sdk1.4.2
path = C:\j2sdk1.4.2\bin

Folders
Native Library Directory -> c:\j2sdk1.4.2\jre\bin
Java Library Directory -> c:\j2sgk1.4.2\jre\lib\ext
Xith3D -> c:\Xith3D

Ok… I’ve put these files at Java Library Directory:
junit.jar (misc)
log4j.jar (misc)
vorbis.jar (misc)
vecmath.jar (vecmath)
joal.jar (joal)
jogl.jar (jogl)
jogl-natives-win32.jar (jogl)

In the Native Library Directory I’ve pu these files:
OpenAL32.dll (joal)
joal.dll (joal)
jogl.dll (jogl)
jogl_cg.dll (jogl)

On folder Xith3D i’ve put xith3d.jar

I’m getting this error when I try to run the HelloXith3D.java.
with the compilation I have no problem (javac -classpath xith3d.jar HelloXith3D.java)
but when I run the program (java -classpath xith3d.jar HelloXith3D) I get this error:

  "c:\Xith3D>java -classpath xith3d.jar HelloXith3D
  Exception in thread "main" java.lang.NoClassDefFoundError: HelloXith3D"

So what is my problem?

Thanks.

wow, I wish all posts were as detailed as that, makes it very easy :slight_smile:

HelloXith3D is part of the getting started guide examples. Try running a bundled Xith3D example. They all start with “com.xith3d.test” and are listed here: http://xith.org/demo/com.xith3d.test.php

For example - try “com.xith3d.test.CubeTest” or “com.xith3d.test.Xith3DTexCoordGenerationTest”

To run HelloXith3D and other getting started guide examples, download the example files here: http://xith.org/tiki-index.php?page=Docs and add the .jars to your classpath.

or - you can grab the code and compile it yourself - from the tute: "If you want to compile a test program - try the HelloXith3D example. Copy the HelloXith3D.java file into your Xith Directory. Then - since all of the required libraries are installed you can simply run javac -classpath libs/xith3d.jar HelloXith3D.java to compile it and then java -cp libs/xith3d.jar HelloXith3D to run it. "

As you probably are aware - that error means that the class is missing from your class path. An easy way to check is to open the .jar in WinZip (unzip -l on *nix) and search for the class you told java to run. Usually it’s either missing, spelt differently, or in a package. Of course it might be possible said class could be in your /ext directory, but it’s not generally a good practice to have runnable classes in that directory which is why we don’t tell people to put xith3d there anymore…

Have fun :slight_smile:

Cheers,

Will.

Ok… Now I’m trying run an executable located at the file xith3d.jar. it is the file com.xith3d.test.HelloXith3D.class but still I’m having problems, since it can’t locate the vecmath.jar. But how can this be possible if I’ve put it in the correct location? :-/

“C:\Xith3D>java -classpath xith3d.jar;. com.xith3d.test.HelloXith3D
Exception in thread “main” java.lang.NoClassDefFoundError: javax/vecmath/Tuple3f”

I’m guessing you have the same problem as a many previous posters. I thought we added it to the Install FAQ, but I dont remember…

Java installs the JRE as well as the SDK, both into different folders.

Your path element is:
path = C:\j2sdk1.4.2\bin

But you say that your libraries are in:
Folders
Native Library Directory -> c:\j2sdk1.4.2\jre\bin
Java Library Directory -> c:\j2sgk1.4.2\jre\lib\ext

What you need to do is make sure that the path to your JRE is BEFORE your path to the SDK. So they both still work, but when you run java.exe, it uses the JRE version, which contains all your libs. I’ll see if I can put this in WIKI.

Oh, also make sure that you dont have any other stray java.exe’s floating around. I seem to always find one in my windows directory after installing a bunch of programs ??? remove anything like that if its in your path before the above.

Good changes to the tute - thanks for that ;D

Do you know what the “normal” windows case is for someone who has installed the SDK (and no other versions)? I thought it was jre - but I may be wrong. I think we should recommend

Installing multiple versions of java is a nightmare on Windows systems. Partly because it’s easy to get confused over what version is being used - but sometimes even I have seen it default to the older verion :frowning:

Cheers,

Will.