@kruze said: Hi all!I just run into the same problem.
I’ve been working on a game since september and I use this class everytime I start up my game. About 30 minutes ago, my SDK failed to run my game due to lack of memory. So I restarted my pc to have a clean start, and when I hit run, the error above welcomes me. I was not able to run my game since pc restart because it tells me that my GameState class is missing, but I can confirm that it’s there, it has always been there (and will be) with the same package name.
Clean and rebuil doesn’t help.
[java]
Exception in thread “main” java.lang.NoClassDefFoundError: mygame/states/GameState
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: mygame.states.GameState
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)
… 6 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
[/java]
Try doing what I did, refactor the class name and see if it runs, then refactor back, that worked for me a few times.
Hope this helps.
As for this heap poo. The heap should be bigger automatically, and there should be an easier way to fix the size, especially for noobies to what exactly we need. I tried changing the values according to the tutorial, but it got reset back to it’s old values, so Idk what’s up with that.