GustavXIII
Jr. Member   Posts: 57
|
 |
«
on:
2012-01-06 08:48:18 » |
|
Hi! Is someone using Slick and can make a executable jar? If I start my game throught netbeans it run 100%.
Now I wanted to make a .jar. But when I execute my .jar from the dist directory I get an error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
I found many threads on google but no real solution. I put the lwjgl.dll in my lib directory an change the VM Path to that but still the error.
Had someone the same problem?
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3560 Medals: 30
TUER
|
 |
«
Reply #1 on:
2012-01-06 09:10:00 » |
|
Hi Why not using Java Web Start as you already have a JAR for your application and using a third party library like LWJGL only requires to add a single line into a JNLP file? Have you read this? http://slick.cokeandcode.com/wiki/doku.php?id=webstartWhen you use Slick with Java Web Start, LWJGL is bundled with it, you don't have to deploy it separately: Use the command "javaws" instead of "java -jar" to test your JNLP file. I don't know whether it is possible to create a fat JAR containing both your game, Slick and LWJGL. At a certain step, native libraries have to be unpacked (from the JAR), don't they? You can put native libraries into a given directory and set the Java library path in order to tell the JVM where to find them.
|
Julien Gouesse
|
|
|
ra4king
JGO Kernel      Posts: 3160 Medals: 196
I'm the King!
|
 |
«
Reply #2 on:
2012-01-06 09:14:31 » |
|
|
|
|
|
Games published by our own members! Go get 'em!
|
|
Cero
JGO Neuromancer     Posts: 1050 Medals: 18
|
 |
«
Reply #3 on:
2012-01-06 10:59:44 » |
|
always a pain I use the eclipse export thing, which works great - it puts the jars that you need wherever you want, inside the jar or not then you still have to have a folder with all the lwjgl native files and do -Djava.library.path=natives_folder
|
|
|
|
gouessej
JGO Kernel      Posts: 3560 Medals: 30
TUER
|
 |
«
Reply #4 on:
2012-01-09 05:31:09 » |
|
always a pain I use the eclipse export thing, which works great - it puts the jars that you need wherever you want, inside the jar or not then you still have to have a folder with all the lwjgl native files and do -Djava.library.path=natives_folder
It won't work on all platforms as you can set only a single path. Is it possible to bundle all native libraries of LWJGL into a JAR and use a mechanism of dynamic loading (able to extract native libraries and load them at runtime)?
|
Julien Gouesse
|
|
|
|
|
Cero
JGO Neuromancer     Posts: 1050 Medals: 18
|
 |
«
Reply #6 on:
2012-01-09 07:12:30 » |
|
always a pain I use the eclipse export thing, which works great - it puts the jars that you need wherever you want, inside the jar or not then you still have to have a folder with all the lwjgl native files and do -Djava.library.path=natives_folder
It won't work on all platforms as you can set only a single path.... No idea what you mean - it does work on all platforms. the eclipse export thing takes charge of the external jars I use; while I just say -Djava.library.path=lib. and in the lib folder (not a jar), there are all the natives for all platforms
|
|
|
|
Orangy Tang
JGO Kernel      Posts: 2960 Medals: 37
Monkey for a head
|
 |
«
Reply #7 on:
2012-01-09 09:32:35 » |
|
always a pain I use the eclipse export thing, which works great - it puts the jars that you need wherever you want, inside the jar or not then you still have to have a folder with all the lwjgl native files and do -Djava.library.path=natives_folder
It won't work on all platforms as you can set only a single path.... No idea what you mean - it does work on all platforms. the eclipse export thing takes charge of the external jars I use; while I just say -Djava.library.path=lib. and in the lib folder (not a jar), there are all the natives for all platforms I'm assuming he means because LWJGL and Jogl usually have their native libraries in sub-dirs in their distribution for each platform. For LWJGL I always end up unpacking them into a single directory because IIRC none of them share names. I don't know about Jogl though.
|
|
|
|
sproingie
JGO Strike Force    Posts: 901 Medals: 55
|
 |
«
Reply #8 on:
2012-01-09 11:43:56 » |
|
Aren't the solaris and linux libraries both named liblwjgl.so?
|
|
|
|
|
Orangy Tang
JGO Kernel      Posts: 2960 Medals: 37
Monkey for a head
|
 |
«
Reply #9 on:
2012-01-09 11:45:32 » |
|
Might be, but who plays games on Solaris? 
|
|
|
|
Games published by our own members! Go get 'em!
|
|
ra4king
JGO Kernel      Posts: 3160 Medals: 196
I'm the King!
|
 |
«
Reply #10 on:
2012-01-09 11:57:48 » |
|
@GustavXIII That error is not related to LWJGL. It's an FMOD error, maybe you didn't include the FMOD libraries?
|
|
|
|
GustavXIII
Jr. Member   Posts: 57
|
 |
«
Reply #11 on:
2012-01-09 12:04:30 » |
|
@GustavXIII That error is not related to LWJGL. It's an FMOD error, maybe you didn't include the FMOD libraries?
Yes but why? I include it in the manifest: lib/NativeFmodEx-win.jar Am I missing some file? *grr*
|
|
|
|
|
ra4king
JGO Kernel      Posts: 3160 Medals: 196
I'm the King!
|
 |
«
Reply #12 on:
2012-01-09 12:14:58 » |
|
Oh are the natives inside the Jar? That doesn't work unless the FMOD library extracts them and loads them itself.
|
|
|
|
sproingie
JGO Strike Force    Posts: 901 Medals: 55
|
 |
«
Reply #13 on:
2012-01-09 12:16:24 » |
|
Might be, but who plays games on Solaris?  Nobody on linux does, that's for sure, which means if you unpack all the natives in the same place, you'll have an awful hard time when the solaris libs overwrite the linux ones.
|
|
|
|
|
GustavXIII
Jr. Member   Posts: 57
|
 |
«
Reply #14 on:
2012-01-09 12:48:00 » |
|
Oh are the natives inside the Jar? That doesn't work unless the FMOD library extracts them and loads them itself.
No I put them in the native directory which you can see on my image ^^ I included it in the maifest: natives/NativeFmodDesigner.dll natives/NativeFmodDesigner64.dll natives/NativeFmodEx.dll natives/NativeFmodEx64.dll Maybe I need some other .dll?!? I cant find another one having this problem *_*
|
|
|
|
|
Cero
JGO Neuromancer     Posts: 1050 Medals: 18
|
 |
«
Reply #15 on:
2012-01-09 13:37:51 » |
|
Aren't the solaris and linux libraries both named liblwjgl.so?
I obviously dont add the solaris libs. Who cares about Solaris; I might as well start supporting like AmigaOS or OS/2. Not only are you running Solaris, which I have not met a single person who has ever seen Solaris run, let alone using it, you're also trying to play a game on it... yeah, right. @FMOD stuff you have to call Init.loadLibraries(); In case of FMOD I actually add those native jars to the build path in eclipse so you have the normal jar and then win, win64, linux, linux64 and mac jar - which all include the natives And you dont need Designer; well if you dont use it that is
|
|
|
|
BoBear2681
Full Member   Posts: 238 Medals: 8
|
 |
«
Reply #16 on:
2012-01-09 13:49:16 » |
|
I use Solaris at work quite frequently. Never play games on it though. 
|
|
|
|
|
Cero
JGO Neuromancer     Posts: 1050 Medals: 18
|
 |
«
Reply #17 on:
2012-01-09 13:55:18 » |
|
I use Solaris at work quite frequently. Never play games on it though.  yeah not a consumer situation
|
|
|
|
sproingie
JGO Strike Force    Posts: 901 Medals: 55
|
 |
«
Reply #18 on:
2012-01-09 14:00:19 » |
|
Despite the name, lwjgl is not just for games.
|
|
|
|
|
GustavXIII
Jr. Member   Posts: 57
|
 |
«
Reply #19 on:
2012-01-10 03:39:40 » |
|
@FMOD stuff you have to call Init.loadLibraries(); In case of FMOD I actually add those native jars to the build path in eclipse so you have the normal jar and then win, win64, linux, linux64 and mac jar - which all include the natives And you dont need Designer; well if you dont use it that is
Ive done it 1 2 3 4 5
| try { Init.loadLibraries(); } catch (InitException ex) { Logger.getLogger(MasterDestroyer.class.getName()).log(Level.SEVERE, null, ex); } |
but still the same error. I will delete FMOD and try it later -.-"
|
|
|
|
|
niq
JGO n00b  Posts: 6
|
 |
«
Reply #20 on:
2012-01-10 09:56:35 » |
|
Hi! Is someone using Slick and can make a executable jar? If I start my game throught netbeans it run 100%.
Now I wanted to make a .jar. But when I execute my .jar from the dist directory I get an error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
I found many threads on google but no real solution. I put the lwjgl.dll in my lib directory an change the VM Path to that but still the error.
Had someone the same problem?
Hi folks, I have been following this forum as a guest for a while .. And I would like to join in  I'm Dane, running Java in Eclipse, using Ubuntu (Linux). Rather new to Java, but I have been coding for some years. I have recently installed Slick (+lwjgl+phys2d) as mentioned by some of you. Then I finally made a program, that was allowed to run on my wifes computer too (Tetris  ) But when making a JAR file and trying to run it, I get the same error as GustavXIII. That is when I create an export to Java/Runnable JAR-files, it gives me a: "no lwjgl in java.library.path" Then i tried to make a "normal" Java/JAR-file export, which results in an: "Exception in thread "main" java.lang.NoClassDefFoundError: org/newdawn/slick/state/StateBasedGame" As said, I'm new to Java, and I've spend last night and most of the day today (it's almost 4pm in DK) making it work. I hope that someone has a solution, or maybe a hint for me  Regards niq
|
|
|
|
|
|
|
|
|
|
|
GustavXIII
Jr. Member   Posts: 57
|
 |
«
Reply #24 on:
2012-01-10 14:07:57 » |
|
I tryed JarSplice too but it always say after I execute the Jarfile: "FATAL ERROR, corrupted File" oO" Maybe I downloadet a version with errors...
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3560 Medals: 30
TUER
|
 |
«
Reply #25 on:
2012-01-10 14:13:54 » |
|
@gouessej I will try it tomorrow.
Ok. You can have a look at the JNLP file used by the game "Flesh Snatcher" in the showcase section, it relies on LWJGL. Just replace the line handling LWJGL by the line handling Slick & LWJGL at the same time, replace its JAR by yours, sign all JARs with the same signature and upload your JAR and your JNLP file onto a server.
|
Julien Gouesse
|
|
|
niq
JGO n00b  Posts: 6
|
 |
«
Reply #26 on:
2012-01-10 14:51:56 » |
|
@GustavXIII The first JAR-file I created was also corrupted  This time I followed this video on "youtube" http://www.youtube.com/watch?v=5stQZqOAM70It seems to be working  Regards
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3560 Medals: 30
TUER
|
 |
«
Reply #27 on:
2012-01-10 15:24:38 » |
|
niq, double-clicking onto a JAR file under Windows opens WinRar by default whereas it works fine on Mac. That's why I advise you to use Java Web Start, an applet or another installer.
|
Julien Gouesse
|
|
|
niq
JGO n00b  Posts: 6
|
 |
«
Reply #28 on:
2012-01-10 15:58:10 » |
|
@gouessej Thanks for your advise  I'll be looking at that next time I have to deploy a program .. I also saw you can change .JAR files to .EXE (Win32) .. I didn't read further than that, and don't know more about it. But would that be recommendable too? .. I'm aware that it doesn't run under other systems. Regards
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3560 Medals: 30
TUER
|
 |
«
Reply #29 on:
2012-01-10 17:01:30 » |
|
@gouessej Thanks for your advise  I'll be looking at that next time I have to deploy a program .. You're welcome. I would like to see your game(s) in the showcase section  Let me know whether you're ready and I will try to help you as much as I can. I also saw you can change .JAR files to .EXE (Win32) .. I didn't read further than that, and don't know more about it. But would that be recommendable too? .. I'm aware that it doesn't run under other systems.
You obviously know this solution is not cross-platform. Some programmers here prefer hiding Java and use tools to perform deep native integration. I advise you to look at this, this sums up the situation pretty well: http://www.excelsior-usa.com/articles/java-to-exe.html
|
Julien Gouesse
|
|
|
|