Archetype defaults do not run the game

Issue #45 new
Anonymous created an issue

Using MacOS X Sierra, I have java jdk 8, maven etc. Avoiding IDEs to test this, I got the archetype:

mvn archetype:generate -DarchetypeGroupId=org.slick2d -DarchetypeArtifactId=slick2d-basic-game-archetype -DarchetypeVersion=1.0.0 -DgroupId=meh -DartifactId=gaem -Dversion=0.0.1-SNAPSHOT -Dpackage=meh

Installing seems to work, but the target's game.sh doesn't seem to setup the java.library.path correctly.

LamblinMBP:gaem dlamblin$ target/gaem-1.0-SNAPSHOT-release/gaem-1.0-SNAPSHOT/game.sh 
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.lwjgl.Sys$1.run(Sys.java:72)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
    at org.lwjgl.Sys.loadLibrary(Sys.java:96)
    at org.lwjgl.Sys.<clinit>(Sys.java:117)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
    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 meh.Game.main(Game.java:42)
LamblinMBP:gaem dlamblin$ java -jar -Djava.library.path=target/natives target/gaem-1.0-SNAPSHOT.jar 
Error: Could not find or load main class meh.Game
LamblinMBP:gaem dlamblin$ java -jar -Djava.library.path=target/natives target/gaem-1.0-SNAPSHOT-release/gaem-1.0-SNAPSHOT/gaem-1.0-SNAPSHOT.jar 
Fri Jul 07 17:32:51 PDT 2017 ERROR:Unable to determine Slick build number
Fri Jul 07 17:32:51 PDT 2017 INFO:LWJGL Version: 2.9.3
Fri Jul 07 17:32:51 PDT 2017 INFO:OriginalDisplayMode: 1440 x 900 x 32 @0Hz
Fri Jul 07 17:32:51 PDT 2017 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Fri Jul 07 17:32:51 PDT 2017 INFO:Starting display 800x600
Fri Jul 07 17:32:51 PDT 2017 INFO:Use Java PNG Loader = true
Jul 07, 2017 5:32:51 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.OSXEnvironmentPlugin
Fri Jul 07 17:32:51 PDT 2017 INFO:Found 0 controllers
LamblinMBP:gaem dlamblin$ 

So the last command works:

java -jar -Djava.library.path=target/natives target/gaem-1.0-SNAPSHOT-release/gaem-1.0-SNAPSHOT/gaem-1.0-SNAPSHOT.jar

It seems to me the game.sh should be fixed or the lib should include the same natives.

Comments (0)

  1. Log in to comment