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.
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.
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.
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.