简体   繁体   中英

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM