I can't run my project

Hello,

I had a project on JMonkeyEngine (I didn’t create this project, i have to work on it for an internship). I can build the project with JME, but i can’t run it with JME. If i run it with JME, it runs the project with old assets, and i get Exception after because it doesn’t found some components in the xml.
But if I use the jar to run it (If i just click on the jar generate by the build instruction), it is working perfectly.

What could be the problem ?

Thanks a lot

Did you try clean&build?

Yes i tried it, it doesn’t change anything.
The weird thing is that i didn’t use the old assets in my project, i don’t know where they come from.

Those assets must be in your classpath somewhere. It can’t be otherwise. Either they are in a jar dependency or in your global classpath… or something.

Try building and running the app from the dist dir. If you still get the issue then you can check to make sure your classpath is empty and see exactly what dependencies were put into dist/lib.

Actually when i do a Clean and Build, i got this :
Not copying library C:\Users\arnaud\Documents\SODARTBON\Source_Sordart\Source_Sordart\AircraftDebrisSimulator\dist\lib\assets.jar , it can’t be read.

Looks like either some user rights issue or you use the jar otherwise while the build is done (e.g. an instance of the app is running or so)

So i will tried to be more specific, i get this exception if i run my program from the IDE :
[java]WARNING: missing element/control with id [widthoffield] for requested control class [de.lessvoid.nifty.controls.Label]
Apr 17, 2014 10:22:20 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at de.lessvoid.nifty.controls.label.LabelControl.getTextRenderer(LabelControl.java:64)
at de.lessvoid.nifty.controls.label.LabelControl.setText(LabelControl.java:45)
at uni.sodart.MenuState.goToDone(MenuState.java:272)
at uni.sodart.StateController.simpleUpdate(StateController.java:190)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:242)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:744) [java][/java] [/java]

But i don’t have it if i click on the jar of my project.

To illustrate better my problem :
Here is the first screen of my project (It’s an AppSettings) :

Edit : On the left it it is the screen i see when i click on the jar of my project, on the right it is the screen i see when i run my project from the IDE.

@aprouzeau said: On the right it it is the screen i see when i click on the jar of my project, on the right it is the screen i see when i run my project from the IDE.

Which right?

I edit sorry.

If it helps, the left screen is an older version of JME. The right screen is a newer version of JME.

Ok, it helps, how is it possible that the jar in the diet file uses an old version of JME and when i run the project with the IDE it uses the newest version ?

@aprouzeau said: Ok, it helps, how is it possible that the jar in the diet file uses an old version of JME and when i run the project with the IDE it uses the newest version ?

(shrug) Maybe you have stuff in your classpath?

I don’t know. When you run from the .jar file it’s using the stuff in the dist/lib directory.

Ok, i will check my Classpath.
This difference of version can explain the exception i got with the new version ?