0
votes

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
1
Have you exported it as a runnable jar?Daniel
Is the lwjgl.jar in your classpath or the class org/lwjgl/LWJGLException in your jar file?Jens
I've tried that and it didn't work @Danieluser2981826
If it's runnable try java.exe -jar <name>.jar. Last jar may be optional but it won't hurt.ChiefTwoPencils
@ChiefTwoPencils No. The error is that a required class file is not found. It has nothing to do with how the JAR is executed.Duncan Jones

1 Answers

0
votes

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.