I'm making a small platformer game and I want to learn how to make it a runnable jar file.
I exported the project as a runnable jar file using eclipse and it created a car file. However, whenever I double click the jar file it created, nothing happens.
So, I tried to run the jar file from the cmd line by navigating to my desktop (where I saved the jar file) and using java -jar ShittyJumper.jar (the name of my file).
When I hit enter I get two errors:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
at main.Main.main(Main.java:26)
... 5 more
C:\Users\Haden\Desktop> -Djava.library.path=lib/lwjgl/natives -jar ShittyJumper.
jar
'-Djava.library.path' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Haden\Desktop>-Djava.library.path=windows -jar ShittyJumper.jar
'-Djava.library.path' is not recognized as an internal or external command,
operable program or batch file.
I have already configured my build path within eclipse to include the lwjgl native windows folder.
How do I create a runnable jar file for my game?