JMonkey not recognizing classes? java.lang.NoClassDefFoundError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NoClassDefFoundError: World/Chartographer
at World.RegionBase.<init>(RegionBase.java:64)
at mygame.Main.createScene(Main.java:69)
at mygame.Main.simpleUpdate(Main.java:48)
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)
Caused by: java.lang.ClassNotFoundException: World.Chartographer
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 8 more

BUILD SUCCESSFUL (total time: 10 seconds)

This is the log of JMonkey, pretty much sayin we don’t know what you doin’, cause we don’t see no class there.

In all seriousness, this is a repeat problem with Jmonkey, that seems to only be solved by starting a new project, even if the files are the same.
Now, it is probably my fault (interrupted a scan or something), but it is really annoying and makes it impossible to test my code.

Do any of you know a fix for this?
A way to make JMonkey remember the files are where they are supposed to be?

1 Like

Hate to bump this so soon… but this is a very annoying problem that I can’t find a solution too.

Just hope there is a fix, like a forced jmonkey update or something.

1 Like

Could you privide an image of your project? The directory in the jmonkey sdk? I had some problems a while ago with my source files not being recognized as source files because they werent correctly in the project, it happened because I started a new project and just dragged my old classes over and didnt select the old project folder with “existing sources” or something like that in the new project dialogue.

1 Like

<iframe src=“Welcome to Flickr!” width=“75” height=“75” frameborder=“0” allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>

there we are, if that doesn’t work:

Imgur

What is weird is this happened after running it a great deal of times, just to debug stuff.

-Thank you

Did you try clean&build?

@normen said: Did you try clean&build?

I’m probably going to sound like a noob again… but I did that, then tried to run the project, and it is the same.

Sorry for my low quality questions…

Maybe try deleting the netbeans cache, delete everything in [USER_HOME].jmonkey\7.x\var

Not home so I dont know if thats the right location, but I know the cache is the var folder.

Maybe also try copying everything in the offending class, deleting it, creating a new class with a slightly different nam, and paste in all the code, and correct all the references to that class to use the slightly different class name. This would be a temporary fix until we can find out whats actually going on. This is a netbeans thing, and has nothing to do with jmonkey so you might want to cross post to netbeans forum to see if anyone can help you there too.

I had that problem,too.

You have to resave the files. This means, write something into the missing file, remove the added content and save that file again.

edit:

You have to do that for all files that are listet as missing :confused:

I did it and my problem in java.lang.NoClassDefFoundError got solved.