Slick Forums

Discuss the Slick 2D Library
It is currently Mon Jun 18, 2018 7:49 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Apr 26, 2012 4:08 pm 
Offline

Joined: Thu Apr 26, 2012 4:03 pm
Posts: 2
I've been programming an turn based strategy game with Netbeans using slick2d library. It runs properly when running it with netbeans. The problem is that it doesn't run after I build it. I've added libraries and manifest file seems to be ok. When I tried to run the game from command file with command "java Verkkohakki.jar" it gives an error "Error: Could not find or load main class Verkkohakki.jar". I've searched forum and googled, but haven't found any answer.


Top
 Profile  
 
PostPosted: Fri Apr 27, 2012 5:48 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1242
As Netbeans tells you in the readme.txt it generates - you need to run with "java -jar Verkkohakki.jar"

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Fri Apr 27, 2012 9:37 am 
Offline

Joined: Thu Apr 26, 2012 4:03 pm
Posts: 2
MatthiasM wrote:
As Netbeans tells you in the readme.txt it generates - you need to run with "java -jar Verkkohakki.jar"


Exception in thread "main" 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:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
at org.lwjgl.Sys.loadLibrary(Sys.java:84)
at org.lwjgl.Sys.<clinit>(Sys.java:101)
at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
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 verkkohakki.VerkkoHakki.main(VerkkoHakki.java:21)

Now this happens. All the library files are included in manifest.


Top
 Profile  
 
PostPosted: Fri Apr 27, 2012 3:59 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
This is because -Djava.library.path is not set in the VM arguments. There is a little info about it at the bottom of this wiki page.

Alternatively, you could move your native files (DLLs, etc) to the same folder as you run your JAR from. Ideally you should set the VM flag, though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group