Hey all,
When I try to run my 3079 game on another Windows 7 machine, I get this error:
[java]C:Program Files (x86)3079>java -jar 3079.jar
Oct 20, 2011 5:45:36 PM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkeyEngine 3.0.0 Beta
Oct 20, 2011 5:45:36 PM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: null
Oct 20, 2011 5:45:36 PM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: C:Program Files (x86)3079
Oct 20, 2011 5:45:36 PM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: C:Program Files (x86)3079
Oct 20, 2011 5:45:36 PM com.jme3.system.JmeSystem initialize
SEVERE: Error while copying native libraries
java.io.FileNotFoundException: C:Program Files (x86)3079lwjgl.dll (Access is
denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at com.jme3.system.Natives.extractNativeLib(Natives.java)
at com.jme3.system.Natives.extractNativeLib(Natives.java)
at com.jme3.system.Natives.extractNativeLibs(Natives.java)
at com.jme3.system.JmeSystem.initialize(JmeSystem.java)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java)
at Game.MainForm$4.run(MainForm.java)
at java.lang.Thread.run(Unknown Source)
Exception in thread “LWJGL Renderer Thread” java.lang.UnsatisfiedLinkError: Can’
t load library: C:Program Files (x86)3079lwjgl.dll[/java]
I tried setting JmeSystem.setLowPermissions(true); – and then I get this error on my Ubuntu development machine:
[java]Oct 20, 2011 5:09:38 PM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkeyEngine 3.0.0 Beta
Exception in thread “LWJGL Renderer Thread” java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at org.lwjgl.Sys$1.run(Sys.java:73)
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 com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:204)
at java.lang.Thread.run(Thread.java:679)[/java]
Running 3079 as administrator on the Windows 7 machine allows my game to run… but this doesn’t seem like the right solution
This looks like a kind of silly user rights bug… Somehow theres write access to the Programs folder and it gets chosen for extracting the binaries, maybe @Momoko_Fan has an idea?
After revision r8471, now I get this error on the same Windows 7 machine:
[java]C:Program Files (x86)3079>java -jar 3079.jar
Oct 21, 2011 11:53:31 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkeyEngine 3.0beta
Exception in thread "Thread-3" java.lang.NullPointerException
at com.jme3.system.Natives.computeNativesHash(Natives.java)
at com.jme3.system.Natives.getExtractionDir(Natives.java)
at com.jme3.system.Natives.extractNativeLibs(Natives.java)
at com.jme3.system.JmeSystem.initialize(JmeSystem.java)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java)
at Game.MainForm$4.run(MainForm.java)
at java.lang.Thread.run(Unknown Source)[/java]
… still no go
On another possibly related note: I have to manually extract the natives (liblwjgl64.so / libopenal64.so) on my development machine from 3079/libs to whatever directory jme3 wants to put them – because jme3 will extract libraries that still cause the OpenAL native stubs exception (no idea where it gets them, /usr/lib perhaps?)
Uh, you replace the jME3-lwjgl-natives.jar for that, not the file it extracts ^^
[java]phr00t@phr00t-newlaptop:~$ find -name ‘*natives.jar’ -exec ls -al ‘{}’ +
-rw-r–r-- 1 phr00t phr00t 2046075 2011-10-19 12:03 ./jmonkeyplatform/jmonkeyplatform/libs/jME3-lwjgl-natives.jar
-rw-r–r-- 1 phr00t phr00t 2046075 2011-10-21 10:54 ./jmonkeyplatform/jmonkeyplatform/modules/ext/jME3-lwjgl-natives.jar
-rw-rw-r-- 1 phr00t phr00t 2046075 2011-10-21 12:03 ./jMonkeyProjects/3079/dist/lib/jME3-lwjgl-natives.jar
[/java]
All of my jME3-lwjgl-natives.jar files are the latest (I double-checked the datestamps inside the jars), so there isn’t any jME3-lwjgl-natives.jar that don’t have the right natives
The binaries in my jME3-lwjgl-natives are not the same that get extracted:
[java]phr00t@phr00t-newlaptop:~/.jme3/natives_7a35b34f$ ls -al
total 1580
drwxrwxr-x 2 phr00t phr00t 4096 2011-10-21 13:33 .
drwxrwxr-x 3 phr00t phr00t 4096 2011-10-21 12:04 …
-rw-rw-r-- 1 phr00t phr00t 383920 2011-10-14 20:12 auto_liblwjgl64.so
-rw-rw-r-- 1 phr00t phr00t 395431 2011-10-14 20:12 auto_libopenal64.so
-rw-rw-r-- 1 phr00t phr00t 428976 2011-10-15 23:28 liblwjgl64.so
-rw-rw-r-- 1 phr00t phr00t 395431 2011-10-15 23:28 libopenal64.so
[/java]
The “auto_” libraries are the ones automatically extracted by 3079. The last two are the ones I manually extracted from jME3-lwjgl-natives.jar. Notice the automatically extracted liblwjgl64.so is 383920 bytes, which must be a broken / old one. I have no idea where it is coming from…
Just to check:
[java]phr00t@phr00t-newlaptop:~$ find -name ‘liblwjgl64.so’ -exec ls -al ‘{}’ +
-rw-rw-r-- 1 phr00t phr00t 428976 2011-10-15 23:28 ./.jme3/natives_7a35b34f/liblwjgl64.so
-rw-rw-r-- 1 phr00t phr00t 428976 2011-10-21 10:54 ./.jmonkeyplatform/dev/liblwjgl64.so
[/java]
All are the correct 428976 byte version.
I couldn’t find any copies of liblwjgl64.so in my /lib or /usr/lib directories…
oO why are you doing any extracting yourself anyway? jME3 extracts the binaries automatically. Just make sure you have those natives its supposed to extract in the jME3-lwjgl-natives.jar thats on the classpath
My guess on the crash in computeNativesHash:
[java] URL url = Natives.class.getResource("");
if (url != null) {
StringBuilder sb = new StringBuilder(url.toString());
if (sb.indexOf("jar:") == 0) {
sb.delete(0, 4);
sb.delete(sb.indexOf("!"), sb.length());
sb.delete(sb.lastIndexOf("/") + 1, sb.length());
}
try {
url = new URL(sb.toString());
} catch (MalformedURLException ex) {
throw new UnsupportedOperationException(ex);
}
}
URLConnection conn = url.openConnection();[/java]
… if url is null, that if block is skipped, and goes right into a url.openConnection(); call – which would fire off a NullPointerException.
normen said:
oO why are you doing any extracting yourself anyway? jME3 extracts the binaries automatically. Just make sure you have those natives its supposed to extract in the jME3-lwjgl-natives.jar thats on the classpath
I'm doing extraction myself because jME3 extracts the binaries incorrectly somehow -- if I rely on the binaries jME3 extracts, I still get the OpenAL "nativestubs" exception problem that we were having awhile back. I show this in my post about 45 minutes ago.
Figured out my liblwjgl64.so problem – my 3079 project also used the Shape3D project, which had a bad “dist/libs/jME3-lwjgl-natives.jar” with a bad liblwjgl64.so. I found out jME3 was extracting from the Shape3D libs folder by debugging / stepping through the extractNativeLibs function calls. I’ve removed the Shape3D library reference from 3079, and it all extracts fine now – Yay!
SO, let’s see if this fixes the original problem…
EDIT: Nope computeNativesHash still crashes with a NullPointerException … @momoko_fan, can you have a look?
It works for me. Whats different on your machine that causes it to fail? It should work
This has now been fixed in the latest SVN! Thank you
So, the problem is fixed if the program is installed on the Desktop (where the user has write permissions). The problem still exists when installed on C:program files (x86)3079, where the user does not have write permissions:
[java]C:Program Files (x86)3079>java -jar 3079.jar
Oct 22, 2011 12:58:01 PM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkeyEngine 3.0.0 Beta
Oct 22, 2011 12:58:01 PM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory: C:Program Files (x86)3079
Oct 22, 2011 12:58:01 PM com.jme3.system.JmeSystem initialize
SEVERE: Error while copying native libraries
java.io.FileNotFoundException: C:Program Files (x86)3079lwjgl.dll (Access is
denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at com.jme3.system.Natives.extractNativeLib(Natives.java)
at com.jme3.system.Natives.extractNativeLib(Natives.java)
at com.jme3.system.Natives.extractNativeLibs(Natives.java)
at com.jme3.system.JmeSystem.initialize(JmeSystem.java)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.Application.start(Application.java)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java)
at Game.MainForm$5.run(MainForm.java)
at java.lang.Thread.run(Unknown Source)
Exception in thread “LWJGL Renderer Thread” java.lang.UnsatisfiedLinkError: Can’
t load library: C:Program Files (x86)3079lwjgl.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)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java)
at org.lwjgl.Sys.loadLibrary(Sys.java)
at org.lwjgl.Sys.<clinit>(Sys.java)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.j
ava)
at java.lang.Thread.run(Unknown Source)[/java]
So… this problem is occurring when my game is installed with administrative privileges to a location not writable by the average user (which it is run under).
You should make the application dir writable for the application, I don’t know what installer thingy you use but you should be able to configure that. Still it should extract it to user.home/.jme3 if it cannot write to the current directory. Guess the native is extracted there but not looked for? @Momoko_Fan?
Ah, are you sure you are really using the latest updates? For all jar files?
Ok, I think I fixed this by using getUsableSpace(), which should check for permissions as well.