I’ve just started learning Java (about a week ago) and the last few days I’ve build a little game using Slick2D. Anyway, whenever I export a JAR from eclipse and run it with ‘java blahblahblah.jar’ I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: /Users/andy/Desktop/game/jar
Caused by: java.lang.ClassNotFoundException: .Users.andy.Desktop.game.jar
Everything is ticked to be exported, the LWJGL and Slick2D jars are in the lib folder and I’ve tried FatJar. I’ve looked on the internet and I can’t seem to find any solution that works.
Any help?
You need to use:
Edit:
Based on a comment to your original post, it seems like you are exporting the jar without a manifest. Make sure you choose
Runnable Jarfrom the export menu. Also be sure to select a validRun Configurationfor your game while exporting.