简体   繁体   中英

Jar file not running on mac

I have made a runnable java file on eclipse on my windows 64 bit computer using jre and jdk 8. The runnable file opens on my windows computer and on my desktop windows computer. When i email the jar file over to my mac, the jar file does not work and it gives the error the java jar file "snoman3.jar" could not be launched. I ran it through the terminal and still gives the same error. I have jre 8 on my mac yet it is still not running. There are many duplicates of this question but i could not find a solution that worked for me, may somebody please tell me possible solutions for this? PS I am running OS X yosemite on my mac. The following is the error I am getting. PS I am using the libGDX graphics library.

 java -jar snoman3.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/88/wtc6dz2d5tvdr3qnzb3pq69w0000gn/T/libgdxasma/75260a42/liblwjgl.dylib
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1083)
    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.openal.AL.<clinit>(AL.java:59)
    at com.badlogic.gdx.backends.openal.OpenALAudio.<init>(OpenALAudio.java:70)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:81)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:63)
    at com.rarster.snowman.Main.main(Main.java:15)
    ... 5 more

Looks like you are getting a NullPointerException behind the scenes. InvocationTargetException is just a wrapper for an exception that's thrown within a dynamic invocation.

If I saw your code, I could have helped you more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM