Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  UnsatisfiedLinkError: no lwjgl in java.library.path  (Read 9855 times)
0 Members and 1 Guest are viewing this topic.
Offline GustavXIII

Junior Duke


Projects: 1



« Posted 2012-01-06 13: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?


Offline gouessej
« Reply #1 - Posted 2012-01-06 14: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=webstart

When you use Slick with Java Web Start, LWJGL is bundled with it, you don't have to deploy it separately:
Quote
<extension href="http://slick.cokeandcode.com/demos/slick.jnlp" version="0.4"/>

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.

Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #2 - Posted 2012-01-06 14:14:31 »

http://lwjgl.com/wiki/index.php?title=Distributing_Your_LWJGL_Application

Look at bullets 1 and 2.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2012-01-06 15: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

Offline gouessej
« Reply #4 - Posted 2012-01-09 10: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)?

Offline GustavXIII

Junior Duke


Projects: 1



« Reply #5 - Posted 2012-01-09 11:26:48 »

Ive changed the manifest but it still wont work:

My game directory:
http://www.bilder-space.de/show_img.php?img=bae287-1326108110.png&size=original
lib directory:
http://www.bilder-space.de/show_img.php?img=dd7a73-1326108227.png&size=original
native directory:
http://www.bilder-space.de/show_img.php?img=5f889c-1326108252.png&size=original

my manifest:
Quote
Manifest-Version: 1.0
Main-Class: masterDestroyer.Main
Class-Path: lib/lwjgl.jar lib/slick.jar lib/jinput.jar lib/jogg-0.0.7.jar lib/jorbis-0.0.15.jar lib/NativeFmodDesigner.jar lib/NativeFmodDesigner-win.jar lib/NativeFmodDesigner-win64.jar lib/NativeFmodEx.jar lib/NativeFmodEx-win.jar lib/NativeFmod-win64.jar lib/libLibLoader.so lib/libLibLoader64.so lib/libNativeFmodDesigner.jnilib lib/libNativeFmodDesigner.so lib/libNativeFmodDesigner64.so lib/libNativeFmodEx.jnilib lib/libNativeFmodEx.so lib/libNativeFmodEx64.so natives/lwjgl.dll natives/jinput-dx8.dll natives/OpenAL32.dll natives/jinput-dx_64.dll natives/jinput-raw.dll natives/jinput-raw_64.dll natives/OpenAL64.dll natives/NativeFmodDesigner.dll natives/NativeFmodDesigner64.dll natives/NativeFmodEx.dll natives/NativeFmodEx64.dll

start.bat include this:
java -Djava.library.path="natives/" -jar "Master Destroyer.jar"

If i execute start i get this error he cant find fmodex
http://www.bilder-space.de/show_img.php?img=41aeeb-1326108356.png&size=original
Offline Cero
« Reply #6 - Posted 2012-01-09 12: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

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2012-01-09 14: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.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline sproingie

JGO Kernel


Medals: 202



« Reply #8 - Posted 2012-01-09 16:43:56 »

Aren't the solaris and linux libraries both named liblwjgl.so?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #9 - Posted 2012-01-09 16:45:32 »

Might be, but who plays games on Solaris? persecutioncomplex

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #10 - Posted 2012-01-09 16:57:48 »

@GustavXIII
That error is not related to LWJGL. It's an FMOD error, maybe you didn't include the FMOD libraries?

Offline GustavXIII

Junior Duke


Projects: 1



« Reply #11 - Posted 2012-01-09 17: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*
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #12 - Posted 2012-01-09 17:14:58 »

Oh are the natives inside the Jar? That doesn't work unless the FMOD library extracts them and loads them itself.

Offline sproingie

JGO Kernel


Medals: 202



« Reply #13 - Posted 2012-01-09 17:16:24 »

Might be, but who plays games on Solaris? persecutioncomplex

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.
Offline GustavXIII

Junior Duke


Projects: 1



« Reply #14 - Posted 2012-01-09 17: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 *_*
Offline Cero
« Reply #15 - Posted 2012-01-09 18: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

Offline BoBear2681

JGO Coder


Medals: 19



« Reply #16 - Posted 2012-01-09 18:49:16 »

I use Solaris at work quite frequently.  Never play games on it though.   Tongue
Offline Cero
« Reply #17 - Posted 2012-01-09 18:55:18 »

I use Solaris at work quite frequently.  Never play games on it though.   Tongue

yeah not a consumer situation

Offline sproingie

JGO Kernel


Medals: 202



« Reply #18 - Posted 2012-01-09 19:00:19 »

Despite the name, lwjgl is not just for games.
Offline GustavXIII

Junior Duke


Projects: 1



« Reply #19 - Posted 2012-01-10 08: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 -.-"
       
Offline niq

Junior Newbie





« Reply #20 - Posted 2012-01-10 14: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 Smiley

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  Wink)
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  Smiley

Regards
niq

Offline gouessej
« Reply #21 - Posted 2012-01-10 15:26:12 »

Maybe use Java Web Start as it is explained here in Slick Wiki:
http://slick.cokeandcode.com/wiki/doku.php?id=webstart

Offline GustavXIII

Junior Duke


Projects: 1



« Reply #22 - Posted 2012-01-10 16:46:55 »

If I disable FModEx then I can start my game from the jar.
But I dont know where the error is with FMod...

@gouessej I will try it tomorrow.

@niq Ive done the 2 steps from here:
http://lwjgl.com/wiki/index.php?title=Distributing_Your_LWJGL_Application
I'd made the Manifest and the bat.
Now lwjgl work so you could try it too.
Offline niq

Junior Newbie





« Reply #23 - Posted 2012-01-10 19:01:16 »

Hi again

I would like to thank you for your help Smiley

But I could not get it to work though (the manifest thing) but I was lead to this page:
http://lwjgl.com/wiki/index.php?title=Distributing_Your_LWJGL_Application
where I found a solution which seems to work .. using JarSplice.

I downloaded JarSplice from ninjacave.com/jarsplice

Now my wife can start playing Tetris Wink

Regards
niq
Offline GustavXIII

Junior Duke


Projects: 1



« Reply #24 - Posted 2012-01-10 19:07:57 »

Hi again

I would like to thank you for your help Smiley

But I could not get it to work though (the manifest thing) but I was lead to this page:
http://lwjgl.com/wiki/index.php?title=Distributing_Your_LWJGL_Application
where I found a solution which seems to work .. using JarSplice.

I downloaded JarSplice from ninjacave.com/jarsplice

Now my wife can start playing Tetris Wink

Regards
niq

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...
Offline gouessej
« Reply #25 - Posted 2012-01-10 19: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.

Offline niq

Junior Newbie





« Reply #26 - Posted 2012-01-10 19:51:56 »

@GustavXIII
The first JAR-file I created was also corrupted  Sad

This time I followed this video on "youtube"
http://www.youtube.com/watch?v=5stQZqOAM70

It seems to be working Smiley

Regards
Offline gouessej
« Reply #27 - Posted 2012-01-10 20: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.

Offline niq

Junior Newbie





« Reply #28 - Posted 2012-01-10 20:58:10 »

@gouessej
Thanks for your advise Smiley
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
Offline gouessej
« Reply #29 - Posted 2012-01-10 22:01:30 »

@gouessej
Thanks for your advise Smiley

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  Grin 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

Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (53 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (43 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!