Problems with the installation

I have installed xith3d…(duh.). But I have a problem.
I downloaded HelloXith3D.java and compiled it. But when I tried to run it, I got this error:

Exception in thread “main” java.lang.NoClassDefFoundError: HelloXith3D (wrong na
me: org/xith3d/gsg/HelloXith3D)

I wonder what I have done wrong.

Can anybody help me?

The GSG classes belong to the org.xith3d.gsg package, which means you have to specify the package name. If you downloaded only this file (HelloXith3D.java) the easiest solution is to comment out the package declaration. If you download the whole source of the GSG you’ll find a readme in it, which says how it’s done right. (There’s nothing special for Xith3D, just the usual java commandline syntax.)

That helped me on my may to success, but now I got a new problem I can’t figure out.

When I now try to run HelloXith3D I get this error:

Exception in thread “main” java.lang.NoClassDefFoundError: com/xith3d/scenegraph
/Node

And I thought this was going to be easy as hell :-/

I don’t think xith.jar is in your classpath. Try doing “java -cp <pathtoxith.jar> HelloXith3D” or org.xith3d.gsg.HelloXith3D, whichever it is.

edit: or put xith.jar in the CLASSPATH variable in the system.

Pardon the noob question, I am not too familiar with java as of yet.

C:\xith3d>java -cp libs/xith3d.jar com.xith3d.test.CubeTest
Exception in thread “main” java.lang.NoClassDefFoundError: javax/vecmath/Tuple3f

Any ideas what I may be doing wrong here? Ive followed the directions in the install tutorial…

I tried the other suggestion in the tutorial and got the following:

C:\xith3d>java -cp xith3d.jar com.xith3d.test.CubeTest
Exception in thread “main” java.lang.NoClassDefFoundError: com/xith3d/test/CubeTest

You dont have the required support libraries installed. Namely in your example: vecmath.jar

I have vecmath.jar in c:\j2sdk1.4.2_04\jre\lib\ext which is where the install tutorial says it is supposed to go…

as per the tutorial - if everything is setup correctly, you should be able to run


java -cp libs/xith3d.jar com.xith3d.test.CubeTest

from your xith3d directory.

If that doesn’t work - re-read the tutorial. If it still doesn’t work, read it again.

Then post here. If there’s a flaw in the tutorial - tell us :slight_smile:

Will.

do you have multiple JRE’s installed?

if so you need to make sure you are installing the files into whichever one you are using (type java -version). Perhaps this should be in the tute as it is a common source of problems.

Will.

Thanks for replies so far!

Removed all java installs, removed xith3d. Installed Java SDK 1.4.2_04 in c:\java2

Installed Xith3d in c:\xith3d

Followed tutorial explicitely to install third party files:
Native: c:\java2\jre\bin\
Library: c:\java2\jre\lib\ect\
Xith: C:\xith3d

Copied misc and vecmath to library, copied native and java components for win (joal and jogl) to native and library (as directed), installed Xith3D

Still encountered problems.

“java -cp libs/xith3d.jar com.xith3d.test.CubeTest”

Noticed that /com/xith3d/test/ directories are subdirectories of /src/ Is this a mistake in the install directions? Tried changing to src.com.xith3d.test and tried moving the com directory +subdirectories to xith3d and then deleting the empty /src/ directory.

Both still gave same problem with NoClassDefFoundError

Did some research in other forums, seems that this particular error is related to classpath variable and path…tried a variety of “fixes”.

Finally at a point where c:\xith3d\com\xith3d\test>javac cubetest.java does not return errors, so that part works ok now. Then tried java CubeTest from same directory…now it seems I am getting somewhere: returned errors:

at java.lang.ClassLoader.defineClass0(Unknown Source) etc. etc.
Tried c:\xith3d\com\xith3d\test>java com/xith3d/test/CubeTest

This returns error:
Exception in thread "main java.lang.NoClassDefFoundError: javax/vecmath/tuple3f

c:\xith3d>java -cp libs/xith3d.jar com/xithd/test/CubeTest returns same error.

So, Im back to the tuple problem.

vecmath.jar is in c:\java2\jre\lib\ext

I apologize if it looks like Im stumbling around and dont know what Im doing : ) I have relatively zero experience with Java, and I need xith3d working so I can evaluate a project someone else is working on.

As always, any advice/feedback/suggestions appreciated. Thanks!

winxp pro
2.4ghz/512mb

[quote]Noticed that /com/xith3d/test/ directories are subdirectories of /src/ Is this a mistake in the install directions? Tried changing to src.com.xith3d.test and tried moving the com directory +subdirectories to xith3d and then deleting the empty /src/ directory.
[/quote]
xith3d.jar is a compressed archive containing the relevant files. By doing “-cp libs/xith3d.jar” you include Xith3D in your classpath, which means it should be able to find com.xith3d.test.CubeTest. Can you paste the error message, if you run this command in an unmodified version of Xith3d (2004-04-25 from xith.org). Is it still “Exception in thread “main” java.lang.NoClassDefFoundError: javax/vecmath/Tuple3f”?

we really need that error message :slight_smile:

You can run some Demo’s without installing it using Java Web Start (http://xith.org/tiki-index.php?page=Demos) - in fact you really only need to install it if you want to tinker with the source.

Will.

[quote]do you have multiple JRE’s installed?

if so you need to make sure you are installing the files into whichever one you are using (type java -version). Perhaps this should be in the tute as it is a common source of problems.

Will.
[/quote]
This is exactly what I was thinking. Remember the SDK installs a JRE Also, so you effectivly have 2 java.exe’s.

Make sure that your path statement reflects whatever one you want to use first.

I think by default it uses the one in ?:\program files\java

Change that to your c:\java2\jre\bin\ and hopefully it’ll find those libs.

I hope that makes sense. Basically if you are running java.exe in ?:\program files\java??? and your libraries are installed in the ext directory of c:\java2\jre, its never going to find them.

Sputter: I already mentioned that I uninstalled all versions of java. Only the single sdk is installed now.

As requested, I created a fresh install of xith3d (Xith3D_2004-02-29_cvs.tar) at c:\xith

c:>java -cp libs/xith3d.jar com.xith3d.test.CubeTest

returns same tuple3F error.

Exception in thread"main" java.lang.NoClassDefFoundError: javax/vecmath/Tuple3F

Thanks again for the help folks.

I assume it’s Tuple3f, not Tuple3F.

You need to have the vecmath.jar package installed in your ext. If you have and it still doesn’t work - try adding it at the command line with xith3d.jar (seperated by ; in Windows (: in linux)).

i.e.

java -cp libs/xith3d.jar;vecmath.jar etc

Will.

Good lord, this has been a trip.

Changed path to check /jre/lib/ext/ before winnt/system32/ (saw this recommended elsewhere to try). So, it is seeing vecmath now yay! So it seems the whole issue was just path priority.

Still having some problems though…

C:\xith>java -cp libs/xith3d.jar com/xith3d/test/CubeTest

starting frame speed test
Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl
OpenGL Renderer = GDI Generic
OpenGL Version = 1.1.0
OpenGL Vendor = Microsoft Corporation
OpenGL Extensions = GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture
net.java.games.jogl.GLException: Method “glActiveTextureARB” not available
at net.java.games.jogl.impl.windows.WindowsGLImpl.glActiveTextureARB(Win
dowsGLImpl.java:94)
at com.xith3d.render.jogl.TextureShaderPeer.shade(TextureShaderPeer.java
:580)
at com.xith3d.render.CanvasPeerBase.setState(CanvasPeerBase.java:121)
at com.xith3d.render.CanvasPeerBase.render(CanvasPeerBase.java:99)
at com.xith3d.render.jogl.CanvasPeerImpl.drawBin(CanvasPeerImpl.java:738
)
at com.xith3d.render.jogl.CanvasPeerImpl.display(CanvasPeerImpl.java:909
)
at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.ja
va:74)
at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:198)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:239)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:1010
)
at com.xith3d.scenegraph.View.renderOnce(View.java:732)
at com.xith3d.scenegraph.View.renderOnce(View.java:665)
at com.xith3d.test.CubeTest.(CubeTest.java:181)
at com.xith3d.test.CubeTest.main(CubeTest.java:201)

Thanks again for the help : )

Robert

Xith3D requires OpenGL version 1.2 or greater (see the faq). So, if it’s possible, you’ll need to update your video card drivers.

beat me too it :slight_smile:

who told you to put it in system32? Not the tute I hope. It’s a Java library so it must go on your CLASSPATH (not to be confused with your system PATH).

system32 is where the .dll’s can go (but we recommend the jre/bin/ directory so you don’t clutter up an already cluttered system32 dir).

I’ve added more troubleshooting help to the tutorial based on the questions here. http://xith.org/tiki-index.php?page=Installing

Will.

Hrm, I have the latest nvidia drivers (using a NVidia GeforceFX 5200 AGP 128DDR), Ill look around and see if I need to enable something.

As far as the other stuff, I followed the install tutorial, I didnt put files in system32…as I mentioned, Ive been reading around on other forums about java problems, and apparently javasdk puts (sometimes?) some files in system32…sometimes java looks there first and as a result wont look elsewhere to find other files…so I just put c:\java2\jre\lib\ext; in my path before everything else, and wala, no more problems not finding vecmath. Shrug, one of those things I guess.

I’ll post here again once I get opengl working like it is supposed to.

Thank you again for all of your help!

Robert

Well, this is weird. If I run the Xith3DSphereMotionLightingTest demo from the website (http://xith.org/demo/com.xith3d.test.php) it works fine

Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl
OpenGL Renderer = GeForce FX 5200/PCI/SSE2
OpenGL Version = 1.5.0
OpenGL Vendor = NVIDIA Corporation

But if I run it from:
C:\xith>java -cp libs/xith3d.jar com/xith3d/test/Xith3DSphereMotionLightingTest

I get this:

Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl
OpenGL Renderer = GDI Generic
OpenGL Version = 1.1.0
OpenGL Vendor = Microsoft Corporation
OpenGL Extensions = GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture
net.java.games.jogl.GLException: Method “glActiveTextureARB” not available

Ideas anyone?