user2981826
user2981826

Reputation: 1

NoClassDefFoundError when running exported JAR from Eclipse

I've looked up how to export .jars in eclipse online for hours. I've tried all the tutorials and have not been able to open my game. I've used the command prompt with

java -jar <name>

and get an error that says

Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException.

Here's how I export my .jar in eclipse:

  1. right click on the project and click on "export..."
  2. select "jar"
  3. select src, lib and resource folders
  4. select .classpath and .project
  5. select only "Export generated class files and resources"
  6. select destination
  7. click next twice
  8. select "Generate manifest file"
  9. select the main class
  10. click finish

Upvotes: 0

Views: 2218

Answers (1)

Indrajith
Indrajith

Reputation: 900

Exporting it as jar will just package your project as an archive only. If you want to run it from the jar choose

Export>Runnable Jar File

Make sure you select your main class in the Launch Configuration.

Upvotes: 0

Related Questions