Search code examples
javaexceptionlwjgl

Export jar file in Eclipse with libraries


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?


Solution

  • 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