What am I missing?

Exception in thread “main” java.lang.NoClassDefFoundError:

it reads. I am using Mac OS X, I have replaced the default lwjgl.jar file with the Mac port, and I put the two other files in the directory where the .bat file is. From the .bat file I have made a similarly named file that opens in Terminal but uses the : instead of the ; and in testing on Marble Fun and Dirt and dirt I have gotten errors from terminal of the nature displayed above, at the top of this post. From what I understand it may be the class path, but then again I don’t really, does anyone have a solution?



Pardon if I sound somewhat naive but I don’t have much experience with this, that is Java or jME and I haven’t been able to try jME because of this (though I have attempted quite a few times).

Start by trying to run the webstart demos from the main page. They are jme 0.8 and run on mac. when you click on one, it may save to file to the desktop and you may need (safari users) to add .jnlp to the filename. Then just click on the file to start it.

I managed to get this far:

An error occurred while launching/running the application.

Title: jME Test [renderer.loader.TestFireMilk]
Vendor: Mojo Monkey Coding
Category: Unexpected Error

Unexpected exception: java.lang.NullPointerException


In addition a friend of mine had no luck with a different example on a Windows computer, I don't know if thats related but it does make me wonder why some are able to successfully use them.

I am running webstart version 1.4.2

Is there a stack trace on one of the tabs that you can provide?

Since I am new to this I am not entirely sure of what you mean, however if you mean the error details marked "Exception", then here it is.

java.lang.NullPointerException
at com.jme.app.SimpleGame.cleanup(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at jmetest.renderer.loader.TestFireMilk.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:848)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:808)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:682)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:397)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
at com.sun.javaws.Launcher.run(Launcher.java:167)
at java.lang.Thread.run(Thread.java:552)

Hmm, that’s not much help… it just means AFTER whatever problem it had, it tried to cleanup and got an NPE trying to close a non-existant input. If you are running this via webstart, try opening the webstart control panel and enabling the java console. In the console should be a bit more information. If it says something about lwjgl check gl error (forgot the exact wording) then it is an issue with the card on the computer you are using not supporting something in GL that we use.

I have console out put here if you need any other information I will put forth an effort to find it. Again this is via webstart the only changes is that it was launched from my desktop via the file which has been appended .jnlp so it would be recognized.


Java Web Start 1.4.2_05 Console, started Mon Jan 10 15:24:10 EST 2005
Java 2 Runtime Environment: Version 1.4.2_05 by Apple Computer, Inc.
Logging to file: /Users/Adam/Library/Caches/Java Web Start/log/javaws/javaws59086.log
Jan 10, 2005 3:24:15 PM com.jme.app.BaseGame start
INFO: Application started.
Jan 10, 2005 3:24:16 PM com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
Jan 10, 2005 3:24:16 PM com.jme.system.PropertiesIO load
WARNING: Could not load properties: java.io.FileNotFoundException: properties.cfg (No such file or directory)
java.lang.NoClassDefFoundError: org/lwjgl/Display
at com.jme.system.LWJGLPropertiesDialog.<init>(Unknown Source)
at com.jme.app.AbstractGame.getAttributes(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at jmetest.renderer.loader.TestFireMilk.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:848)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:808)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:682)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:397)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
at com.sun.javaws.Launcher.run(Launcher.java:167)
at java.lang.Thread.run(Thread.java:552)
Jan 10, 2005 3:24:16 PM com.jme.app.SimpleGame cleanup
INFO: Cleaning up resources.

I hope this problem is not irritating anyone.

This looks like it is referencing an old LWJGL library. Do you have any LWJGL.dlls in your path? If so, remove all of them. Then try again.

Yeah, it looks like java is not finding lwjgl… I just tried the same demo you are trying on my Mac, via Safari, renaming the file to .jnlp… It comes up with the screen loading the jars, then it asks me if I want to continue since it is an untrusted cert that signed the code… I click "Start" and I see the props screen… I make sure to choose 640x480, 16bpp, default refresh rate (0hz on Mac and Linux usually) and uncheck full screen… (should work on most machines)



Came up fine. Hmm… any thoughts on what is different?

I can now use webstart (though I find it needs to have .jnlp appended after it is downloaded via plain text). I was able to get this to work by removing lwjgl and jme from my computer’s library.

By the way thanks for helping out. If you know how I can get it working on the computer it’s self let me know.

Now that it works via webstart, you should be able to follow the getting started guide to get a developers setup working. Check that out and then let us know if you hit a snag…