Slick Forums

Discuss the Slick 2D Library
It is currently Sun Apr 20, 2014 6:23 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Jul 19, 2010 3:29 pm 
Offline

Joined: Mon Jul 19, 2010 3:12 pm
Posts: 4
Hey everyone

As a summerproject I wanted to develop a little tycoongame. I discovered that Slick was a good way to graphically enhance this game, so I wanted to give this a try.

However, I can't seem to get it working. I've spent the whole last day trying lots and lots of things, googling, etc. And I can't figure it out.
I hope anybody who runs IntelliJ can help me out?

I've imported the slick.jar and lwjgl.jar into my project. (Project Structure > Project Settings > Libraries > added a library "Slick" > attached classes to it)
IntelliJ does find the classes of Slick, so that works fine. I'm not sure of the lwjgl.jar, but I imported it in the same way as slick.jar
Both jar's show up in classpath, as far as I can tell, but when I try to run my project I get this errormessage:

Code:
"C:\Program Files (x86)\Java\jdk1.6.0_20\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 9.0.2\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\alt-rt.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunpkcs11.jar;C:\Users\Glenn\My Projects\IdeaProjects\TVTycoon\out\production\TVTycoon;C:\Program Files (x86)\Java\slick\lib\slick.jar;C:\Program Files (x86)\Java\slick\lib\lwjgl.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 9.0.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.viqon.TVTycoon.TVTycoonGame
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
   at java.lang.System.loadLibrary(System.java:1028)
   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 com.viqon.TVTycoon.TVTycoonGame.main(TVTycoonGame.java:24)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)


I googled around and i found on the official lwjgl site this:
Quote:
Q: When running the examples or my own program I get a 'Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path.
A: The VM cannot locate the lwjgl runtime library. Specify the path to it using -Djava.library.path=<path/to/library>
But I think it is allready in the classpath (as it shows up in the errormessage classpath)?

It seems to me I have to import the native classes. I tried to include those jar-files (natives-linux, natives-mac, natives-win32) the same way as I did with slick.jar, but that doesn't work either. So for now I left them out.

Does anybody have any idea how to get this working?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 4:12 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1325
Location: Italy
maybe problem is that you need to extract natives jar and point your ide to extracted files based on your operating system?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 5:03 pm 
Offline

Joined: Mon Jul 19, 2010 3:12 pm
Posts: 4
Gornova81 wrote:
maybe problem is that you need to extract natives jar and point your ide to extracted files based on your operating system?

First, thank you for your response.

I've extracted the natives-win32 jar into a folder "natives-win32" and it contained these files:
    jinput-dx8.dll
    jinput-raw.dll
    lwjgl.dll
    OpenAl32.dll


I've tried pointing IntelliJ to the folder "natives-win32" (Project Structure > Project Settings > Libraries > the created library "Slick") through classes, sources and even annotations. But the same errormessage still comes up.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 7:22 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1325
Location: Italy
Here my solution (IMHO):

1) create a new project in IDea
2) make a directory lib
3) put all slick-related jars into lib
4) make a directory lib/natives-win32 (or any os you want to use)
5) right click on project name -> module settings
6) select module settings -> dependencies, add single file dependencies, add all jars in lib
7) open run-> edito configurations -> VM parameters , write: -Djava.library.path=lib/natives-win32

run and have fun :D

p.s: why this IDE?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 8:00 pm 
Offline

Joined: Mon Jul 19, 2010 3:12 pm
Posts: 4
THANK YOU!!!! It works!
Follow-up question: how should I configure it if I want the game to run on multiple platforms?

I'll write a detailed how-to this evening for other people who want to use IntelliJ :-)


PS: We use IntelliJ in school (I follow programming classes) and I like it very much. Now it's open-sourced, so I like it even better ;-)
+ from school we get a ultimate-license :P
Any reason I shouldn't?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 8:38 pm 
Offline

Joined: Mon Jul 19, 2010 3:12 pm
Posts: 4
For further usage:

Quote:
Setting up Slick in IntelliJ 9.0
========================

1) Adding the slick jars
----------------------------
a) Download the Full Distribution of "Slick" and extract it
b) Start IntelliJ 9.0, start a project and go to your 'Project Structure' (Ctrl+Alt+Shift+S)
c) Under the 'Project Settings' select 'Libraries'
d) Click on the plus sign on top, give the library a name (ex. 'Slick')
e) On the right click 'Attach Classes...'
f) Go to where you extracted the slick-files and add the lwjgl.jar and slick.jar that you find under ../lib/

2) Adjusting VM parameters
---------------------------------
a) Create a new directory in your project named 'lib' (right click > New > Directory)
b) Go to where you extracted the slick-files and extract the ../lib/natives-win32 (or -linux, or -mac) into a folder named 'natives-win32' (or -linux, or -mac)
c) Copy this map into the 'lib'-directory in your project
d) Open the 'Run/Debug Configurations' (Run > Edit Configurations)
e) Under 'VM Parameters' add: "-Djava.library.path=lib/natives-win32" (or -linux, or -mac) without the quotes

Your IntelliJ project is now configured to use Slick


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2010 6:36 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1325
Location: Italy
XBooster wrote:
THANK YOU!!!! It works!
Follow-up question: how should I configure it if I want the game to run on multiple platforms?

I'll write a detailed how-to this evening for other people who want to use IntelliJ :-)


PS: We use IntelliJ in school (I follow programming classes) and I like it very much. Now it's open-sourced, so I like it even better ;-)
+ from school we get a ultimate-license :P
Any reason I shouldn't?


Glad to be helpful :D

for multiple platforms: slicks run on multiple platforms :D it's Java! (Java4Ever ). Seriously, you can extract all native files to a directory lib/natives and point vm to consider this natives, and all works :D

Good idea to build a little tutorial, use slick wiki!! http://slick.cokeandcode.com/wiki/doku.php

Anyone have different ideas and "taste" for IDE, so IMHO at first point :D
I use Eclipse (last version is named Helios and you can find here: http://www.eclipse.org/downloads/packag ... rs/heliosr) mainly because it's always up to date, easy to use and because i use it at work :D tyy it! :)

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 4:39 pm 
Offline

Joined: Sat Feb 23, 2013 10:04 pm
Posts: 3
Thanks i solved my problems with that!


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

All times are UTC


Who is online

Users browsing this forum: Dan and 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Group