TestTeapot not working on Eclipse

I followed the instructions at http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme





When I ran TestTeapot.java, it launched and then quit and I got the following output:





Sep 13, 2007 9:22:29 AM com.jme.app.BaseGame start

INFO: Application started.

Sep 13, 2007 9:22:29 AM com.jme.system.PropertiesIO <init>

INFO: PropertiesIO created

Sep 13, 2007 9:22:29 AM com.jme.system.PropertiesIO load

WARNING: Could not load properties. Creating a new one.

Sep 13, 2007 9:22:30 AM class jmetest.renderer.TestTeapot start()

SEVERE: Exception in game loop

java.lang.LinkageError: Version mismatch: jar version is '8', native libary version is '11'

at org.lwjgl.Sys.<clinit>(Sys.java:105)

at org.lwjgl.opengl.Display.<clinit>(Display.java:108)

at com.jme.system.lwjgl.LWJGLPropertiesDialog.<init>(LWJGLPropertiesDialog.java:149)

at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:192)

at com.jme.app.BaseGame.start(BaseGame.java:62)

at jmetest.renderer.TestTeapot.main(TestTeapot.java:61)

Sep 13, 2007 9:22:30 AM com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

Sep 13, 2007 9:22:30 AM com.jme.system.lwjgl.LWJGLDisplaySystem <init>

INFO: LWJGL Display System created.

Sep 13, 2007 9:22:30 AM com.jme.app.BaseGame start

INFO: Application ending.





I am relatively new to Java. What is the difference between the jar version and the native library version (other than 5).

Most likely you have an old version of Java, and thus is unable to use the compressed JAR created with a much newer one.

Or one of Your native librarys version (.dll ?) is not matching the version of Your java lib (.jar)



In Your case lwjgl.dll / .so / .dylib vs. lwjgl.jar could well be the culprit so i'd recommend making a file search for lwjgl.* on Your system to see if there's some old

version lurking around somewhere and doublecheck which versions get used by eclipse.



… would be strange however if other tests run ok.

duenez said:

Most likely you have an old version of Java, and thus is unable to use the compressed JAR created with a much newer one.

This got me curious - can you elaborate on how that particular error message could be related to the JDK version? I never knew that, but it could be useful for some support/troubleshooting cases...
duenez said:

Most likely you have an old version of Java, and thus is unable to use the compressed JAR created with a much newer one.

no, it's not related to the jdk version

winkman is right about the native libraries hanging around somewhere in your system

Hmm. It says lwjgl.jar 1.20 (Binary) under the lib folder in jME required. I did find a copy of lwjgl in a demo app. Deleting it didn't make any difference. I don't think I have another lwjgl installed.

Wait. Actually I think I did find the old jar file :). Guess I didn't search right the first time. Now I am getting this error:



Sep 14, 2007 2:04:09 PM com.jme.app.BaseGame start

INFO: Application started.

Sep 14, 2007 2:04:09 PM com.jme.system.PropertiesIO <init>

INFO: PropertiesIO created

Sep 14, 2007 2:04:09 PM com.jme.system.PropertiesIO load

WARNING: Could not load properties. Creating a new one.

Sep 14, 2007 2:04:09 PM class jmetest.renderer.TestTeapot start()

SEVERE: Exception in game loop

java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException

at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:192)

at com.jme.app.BaseGame.start(BaseGame.java:62)

at jmetest.renderer.TestTeapot.main(TestTeapot.java:61)

Sep 14, 2007 2:04:09 PM com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException

at com.jme.system.lwjgl.LWJGLSystemProvider.getDisplaySystem(LWJGLSystemProvider.java:62)

at com.jme.system.DisplaySystem.getDisplaySystem(DisplaySystem.java:241)

at com.jme.util.TextureManager.doTextureCleanup(TextureManager.java:676)

at com.jme.app.BaseSimpleGame.cleanup(BaseSimpleGame.java:557)

at com.jme.app.BaseGame.start(BaseGame.java:97)

at jmetest.renderer.TestTeapot.main(TestTeapot.java:61)







lol

java.lang.NoClassDefFoundError means that you are missing a jar containing required class on your classpass.

java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException means that you are missing a jar containing org.lwjgl.LWJGLException

that means you are missing (or have a wrong version of) one of the lwjgl jars, probably the core one: lwjgl.jar.



Probably you are trying to use jme with a version of lwjgl that is not supported (either the newer or the older version than the one jme can work with).

Solution: get lwjgl.jar and all the required native libraries from jme CVS, this way you will know the version does match.