[SOLVED]Exception in thread ”main” java.lang.NoClassDefFoundError: com/jme3/app/SimpleAp plication


I’m a beginner in Java (I used to program in c#/ c++ …) and I have only experience with run projects in Netbeans.

Now I tried to run my program directly and clicked on the jar file - I only get a “beep” than I tried it in the console with the string Netbeans/JMP gives me after the build.

java -jar “…jMonkeyProjectsGamedistMyGame.jar”

But I only get this error Message.

Exception in thread “main” java.lang.NoClassDefFoundError: com/jme3/app/SimpleApplication

If I run it in JMP there is no problem.

I think he can’t find the other jar files, but how can I link them?

Sorry for my bad English, I’m not good with languages (I’ll try to improve it :D)

Theres a tutorial in the wiki on how to set up jME in NetBeans, but really, why do you want to do that? jMonkeyPlatform has all features of NetBeans.

Hello thanks for your reply. I dont want to set up in Netbeans, I like JMP :smiley: But I want to send the jar files to a friend, so he can test it (But not the source-code, and I dont want him to download jmp…)

(I need a file where my friend only have to click on it to start the game :smiley: Sorry for the beginner question, I done some projects, but I hadn’t to publish it xD)

He just needs java installed, then he can just double-click the jar file.

I get only this “beep” and in the console the failure message :confused: That is my Problem^^

You need to have the main jar file and the lib directory and then run the command in the directory where the jar and lib dir is: java -jar MyGame.jar

Ah okay I forgot to rename the libs Directory (C:Programmejmonkeyplatformlibs) I copied to lib.

Now I can start the Program, but it doesn’t find other files (I have to copy the directory of my assets folder to the root folder of the game). And than he cant find my mesh :smiley: But I think I will get this to work by myself :smiley:

Thanks for your fast help.

No, there should be a lib directory in your dist folder after building. If its not then you probably get a warning during building (only happens when you add folders to the libraries of your project instead of properly wrapped jar libraries).

Nope in the dist folder is nothing but the MyGame.jar file. I used the “BasicGame” Project in JMP, but I can’t find a lib folder?

Okay… I created a new Project and there was the lib folder in the dist :confused:

I have one other Problem:

I stop the program but the process is stil there (in the task manager). In JMP I need to stop it in the output field.

Could I create some Thread problems or Memory leak? xD

(I used a new Thread because I had some problems with Network xD )

So you probably get a warning during compile, what does it say? Did you add any folders to the project library settings?

Ah okay your right I had add an old project and he couldnt find it :smiley:

Now he copy the lib folder in my dist folder :smiley: Thanks ^.^

Now I have only the problem that I can’t quit the process :confused:

14.12.2010 01:29:02 de.lessvoid.nifty.effects.EffectProcessor startEffect
INFO: starting effect [(ImageOverlayPulsate)]
14.12.2010 01:29:04 com.jme3.input.lwjgl.LwjglMouseInput destroy
INFO: Mouse destroyed.
14.12.2010 01:29:04 com.jme3.input.lwjgl.LwjglKeyInput destroy
INFO: Keyboard destroyed.
14.12.2010 01:29:04 com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread
INFO: Display destroyed.

But I need to stop it with the Button :/
Sorry for my beginner questions, but I'm really happy that you help me :)

Okay I think it's not the best way but I add something to the destoy function :D

public void destroy()

Thanks for your help :)