Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run .jar on OSX #19

Open
rubinkazan opened this issue May 2, 2017 · 2 comments
Open

Unable to run .jar on OSX #19

rubinkazan opened this issue May 2, 2017 · 2 comments

Comments

@rubinkazan
Copy link

I am unable to open the .jar file on OSX 10.12.4. Using jre 1.8.0_112-b16 and java version 1.8.0_112. It says the 'gui quit unexpectedly'.

I tried running the project via eclipse, the gui now runs however I am left with this error inside the gui window:
Error: Cannot load resource res/native/jsyringeapi.jnilib
Error: Cannot load resource res/native/mux_redux.jnilib
Exception java.lang.NullPointerException
java.io.File.(File.java:277)
java.lang.Runtime.load0(Runtime.java:805)
java.lang.System.load(System.java:1086)
Jsyringe.init(Jsyringe.java:44)
gui.guiInit(gui.java:207)
gui$2.run(gui.java:186)
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
FATAL: Cannot load native libraries; make sure you're using 32-bit JRE if on Windows!

INIT FAILED (Jsyringe)!

@Annonymousse
Copy link

Annonymousse commented May 5, 2017

I have this exact same issue when trying to run it, except im not running it in eclipse nor osx, it wont work on windows. I installed both 64bit and 32bit JRE. If you find a fix, please tell me.

@spotlightishere
Copy link

(Sorry to startle those watching, felt it should be shared.)

String resName = String.format("res/%s", path);
FileOutputStream writer = null;
InputStream is = null;
String result = null;
try {
is = gui.class.getResourceAsStream(resName);
if (is == null) {
gui.error("Error: Cannot load resource %s", resName);
return null;
}

Newer version of Java seem to prefer having /res/%s instead when loading from classpath/resources. This fixed it for Java 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants