One fine day, I decided to test my java skills by building a simple chess game. It took me a while, and after a while I finished. Now the problem starts here: I wanted to send my game to friends, so I created the jar executable via Eclipse. Surprisingly, the game inside the runnable jar file showed some strange behaviors, such as Pieces appearing where they shouldn't appear, and some other strange errors, but without any exceptions. I was even more surprised when I realized that when I run the project inside Eclipse itself, everything works as it should. I also tried to create a normal jar file via Eclipse and run it, but I got the following NPE error:
01/05/12 19:47:30.433 [0x0-0x54054].com.apple.JarLauncher: Exception in thread "main"
01/05/12 19:47:30.498 [0x0-0x54054].com.apple.JarLauncher: java.lang.NullPointerException
01/05/12 19:47:30.498 [0x0-0x54054].com.apple.JarLauncher: at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
01/05/12 19:47:30.498 [0x0-0x54054].com.apple.JarLauncher: at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)
I have already posted one question about this on this website, but I have not received the correct answer, so I am posting this question as well. Here is a link to another question: Getting weird behavior when creating a runnable jar file on eclipse for my chess project .
source
share