Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Problem with lwjgl  (Read 1589 times)
0 Members and 1 Guest are viewing this topic.
Offline Kyperbelt

Junior Devvie


Medals: 1



« Posted 2013-11-06 00:47:03 »

For the past week i have been working on several projects using lwjgl and everything was fine and dandy until i tried sharing my work.

I am running 64 bit jdk and my brother runs 32 bit windows xp. on both of these computers it runs fine.

My other friend is running 64bit java but he gets an UnsatisfiedLink Error

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
C:\Users\Ryan>java -jar C:\Users\Ryan\Desktop\MonMapEdit\MonstersMapEditor.jar
Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: Can't load librar
y: C:\Users\Ryan\native\windows\lwjgl.dll
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at org.lwjgl.Sys$1.run(Sys.java:70)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
        at org.lwjgl.Sys.loadLibrary(Sys.java:95)
        at org.lwjgl.Sys.<clinit>(Sys.java:112)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
        at dragonhawk.monsters.mapeditor.editor.EditorWindow.run(EditorWindow.ja
va:161)
        at java.lang.Thread.run(Unknown Source)

i cant seem to figure out the problem , we have had him uninstall java and re install several times but still nothing.
im starting to think its something wrong with my set up.

anyone have any idea of what can be wrong?
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #1 - Posted 2013-11-06 01:14:41 »

You need to include the LWJGL files in the program, and put them in the build path. Right now its searching for the files you linked from your computer, but seeing as they don't exist on your friend's computer, its throwing a link error.

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #2 - Posted 2013-11-06 01:29:02 »

You need to include the LWJGL files in the program, and put them in the build path. Right now its searching for the files you linked from your computer, but seeing as they don't exist on your friend's computer, its throwing a link error.

If you mean the natives, everything is already inside the folder.

https://www.dropbox.com/s/01bp959iuggyss1/MonMapEdit.zip

There is a download link if you care to check it out. it would put my mind at ease to know if it runs on other peoples comps and not just mine and my brothers.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #3 - Posted 2013-11-06 01:32:38 »

Well, I downloaded it and ran it through a console, and I didn't get any errors. It crashed, though after I loaded it up. It would just stop responding. Other than that, it ran fine.

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #4 - Posted 2013-11-06 01:59:41 »

Well, I downloaded it and ran it through a console, and I didn't get any errors. It crashed, though after I loaded it up. It would just stop responding. Other than that, it ran fine.

yeah takes a while to load up since it is making the tiles on start up from a buffered image and then making them into individual buttons.
if you run it and wait around 4-5 secs it should work fine.

also dont push the load+ button hehe. i mean for it to have some use further down the line.

glad to hear its not my set up. would still love some feedback on why its not working on my friends computer :/
Offline SHC
« Reply #5 - Posted 2013-11-06 02:28:02 »

What is the architecture of your friend's PC? I think it causes some problem.

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #6 - Posted 2013-11-06 02:36:23 »

What is the architecture of your friend's PC? I think it causes some problem.

made him run os.arch and got amd64

his java works fine , and we are using all the latest versions of everything(java and lwjgl)

is there some other reason why it wont run? he has tried to compile and run it himself and it works fine in the ide just not as standalone runnable jar
Offline cobolfoo

Junior Newbie





« Reply #7 - Posted 2013-11-06 04:18:04 »

You are doing this:

C:\Users\Ryan>java -jar C:\Users\Ryan\Desktop\MonMapEdit\MonstersMapEditor.jar

It means that your current working directory is c:\Users\Ryan.

I guess you want to have C:\Users\Ryan\Desktop\MonMapEdit\ as current working directory no?

Maybe you need to go inside this folder and run:

java -Djava.library.path=native/windows -jar MonstersMapEditor.jar

?

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #8 - Posted 2013-11-06 05:04:16 »

You are doing this:

C:\Users\Ryan>java -jar C:\Users\Ryan\Desktop\MonMapEdit\MonstersMapEditor.jar

It means that your current working directory is c:\Users\Ryan.

I guess you want to have C:\Users\Ryan\Desktop\MonMapEdit\ as current working directory no?

Maybe you need to go inside this folder and run:

java -Djava.library.path=native/windows -jar MonstersMapEditor.jar

?



yeah but i have this code running to avoid such call and the need of a separate .bat file to run my program

1  
2  
3  
System.setProperty("org.lwjgl.librarypath", new File(new File(System.getProperty("user.dir"),
            "native"), LWJGLUtil.getPlatformName()).getAbsolutePath());
      System.setProperty("net.java.games.input.librarypath", System.getProperty("org.lwjgl.librarypath"));


Also like i said, it works fine on 3 different computers now, just not on his. i have confirmed that he indeed has 64 bit windows.

could this be a service pack issue?(just a wild guess)

because i've had him redownload java both 32bit and 64 bit with little success
Offline SHC
« Reply #9 - Posted 2013-11-06 05:10:09 »

There is the error. You are setting the library path to the "native" folder in the user directory. This expects the lwjgl dlls to exist in that folder but it can't find the libraries at that location. So it throws a UnsatisfiedLinkError. Remove the code to set the properties and after exporting the jar, make sure you have the dlls in the same folder of the jar. That should solve the problem.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #10 - Posted 2013-11-06 05:26:46 »

There is the error. You are setting the library path to the "native" folder in the user directory. This expects the lwjgl dlls to exist in that folder but it can't find the libraries at that location. So it throws a UnsatisfiedLinkError. Remove the code to set the properties and after exporting the jar, make sure you have the dlls in the same folder of the jar. That should solve the problem.

hmmm still doesnt explain why it works fine on other comps but not his.. i will def give this a shot but i dont think this is the problem . if you will download the zip and run the program your self so you can see how its set up it would be awesome Smiley link is on the 3rd post;
Offline SHC
« Reply #11 - Posted 2013-11-06 05:35:47 »

Didn't work on my system too. I tested it on Mac OS X 10.8.5 64 bit and Windows 8 Pro 32 bit. Try the method I've said before.

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #12 - Posted 2013-11-06 05:52:47 »

Didn't work on my system too. I tested it on Mac OS X 10.8.5 64 bit and Windows 8 Pro 32 bit. Try the method I've said before.

i made the changes you told me to make but i am unable to test it on my friends comp atm. Is there some reason that the other way does not work? i would really like to have the dlls inside the native folder hehe its the reason i chose that path in the first place.

UPDATE: ok so i woke him up got him to try it because it was killing me and he got the same error still.
Offline SHC
« Reply #13 - Posted 2013-11-06 07:56:36 »

Maybe you are having missing some steps. Try these exactly.

1. Change the code to set the properties to this, so it works when the files are in the 'native' folder.

1  
2  
System.setProperty("org.lwjgl.librarypath", new File(new File("native"), LWJGLUtil.getPlatformName()).getAbsolutePath());
System.setProperty("net.java.games.input.librarypath", System.getProperty("org.lwjgl.librarypath"));

2. Go to "File -> Export -> Runnable Jar File" and export the JAR with "Extract required Libraries" selected.



3. Then copy the natives folder from the LWJGL download archive next to the JAR you exported.
4. Distribute the JAR along with the natives folder.

This should fix the problem.

Offline Kyperbelt

Junior Devvie


Medals: 1



« Reply #14 - Posted 2013-11-06 19:12:46 »

Maybe you are having missing some steps. Try these exactly.

1. Change the code to set the properties to this, so it works when the files are in the 'native' folder.

1  
2  
System.setProperty("org.lwjgl.librarypath", new File(new File("native"), LWJGLUtil.getPlatformName()).getAbsolutePath());
System.setProperty("net.java.games.input.librarypath", System.getProperty("org.lwjgl.librarypath"));

2. Go to "File -> Export -> Runnable Jar File" and export the JAR with "Extract required Libraries" selected.

3. Then copy the natives folder from the LWJGL download archive next to the JAR you exported.
4. Distribute the JAR along with the natives folder.

This should fix the problem.

i did this and i will make him test it later on in the day. also . it doesnt work in macos because i didnt put the natives for macos in the native folder.
thanks for the feedback though Smiley. i just hope it works.
Pages: [1]
  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.

trollwarrior1 (33 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (65 views)
2014-11-07 19:57:14

TehJavaDev (69 views)
2014-11-03 22:04:50

BurntPizza (67 views)
2014-11-03 18:54:52

moogie (82 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
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!