0

So after all those days I finally finished my work for school, but I need to export it to a jar file. My project includes for example LWJGL. I think he finds it, but I get this Exception:

java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException

and so on.

How can I fix this?

besplash
  • 346
  • 1
  • 5
  • 17
  • Possible duplicate of http://stackoverflow.com/questions/10063530/java-library-path-error – Dinal Jun 04 '14 at 09:18
  • http://stackoverflow.com/questions/11033603/how-to-create-a-jar-with-external-libraries-included-in-eclipse – ridoy Jun 04 '14 at 09:35

2 Answers2

0

When you are exporting your jar file Tick the check-box of export generated class files and resources and also export Java source files and resources Then, you should have all the source files.

Ducaz035
  • 3,054
  • 2
  • 25
  • 45
0

I already solved it. Someone told me to add this line to my source code:

System.setProperty("org.lwjgl.librarypath", new File("native").getAbsolutePath());

and it works after I created the "native" folder in my projects folder.

New problem any way is, that my text is only drawn, if I start my program with command line

besplash
  • 346
  • 1
  • 5
  • 17