I have a class called Game in the package net.aGameName and am trying to export a runnable Jar using eclipse. In the project I have two external Jar files added, lwjgl.jar and lwjgl_util.jar.
When I go to File->Export->Runnable Jar File and choose the Launch configuration I use for testing (which works successfully) I am able to export the Jar file without any errors. Finally I open cmd and use
java aGameName.jar and receive the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: aGameName/jar Caused by: java.lang.ClassNotFoundException: aGameName.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: aGameName.jar. Program will exit.
When I open the manifest file it says:
Manifest-Version: 1.0 Class-Path: . Main-Class: net.aGameName.Game
Can anyone easily spot the error that would be causing this? Thanks