- Unable to run .jar on OSX #19
- Comments
- rubinkazan commented May 2, 2017
- Annonymousse commented May 5, 2017 •
- spotlightishere commented Jan 27, 2019
- Cannot load 32-bit SWT libraries on 64-bit JVM
- 5 Answers 5
- Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )
- 13 Answers 13
- Running java in 32 bit mode on windows 64
- 5 Answers 5
- Make sure you re using 32 bit jre if on windows
Unable to run .jar on OSX #19
Comments
rubinkazan commented May 2, 2017
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)!
The text was updated successfully, but these errors were encountered:
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 commented Jan 27, 2019
(Sorry to startle those watching, felt it should be shared.)
Lines 42 to 51 in a5f3a79
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.
Cannot load 32-bit SWT libraries on 64-bit JVM
My computer is win7 64 bit, and jdk is 1.7.0.21,jvm is 1.6.. and 64 bit I want to run SWT application and export as runnable jar file. When I run the application, it has the exception that Cannot load 32-bit SWT libraries on 64-bit JVM, so I import the SDK as alternate jre just like you point at Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file ), and in Eclipse, the application can run correctly, but when I edit the bat file to run the jar file, it always has the problem like Cannot load 32-bit SWT libraries on 64-bit JVM, I have the swt.jar for 64 bit, but I don’t konw how to replace and I wanna edit the bat file with the information with the SDK. How to handle the problem?
5 Answers 5
You have a 64bit JVM so it won’t run the 32-bit SWT libraries. You need to either:
- Download and install the 32bit JVM and change your project’s settings to run the 32bit JVM instead of the 64bit one.
- Download and install the 64bit libraries instead.
This previous SO question has a great description of the first option with accompanying diagrams:
64-bit JVM ? you should use the 64-bit swt
Apart from the appropriate swt lib corresponding to the Operating system and their bitness, sometimes consider the following also:
Eclipse running using the 32 bit JRE
Approach 1: I faced the problem when I was replacing the 32 bit swt with 64 bit swt to test on other platforms. To resolve, I had to remove/clean the project and rebuild the project with the 64 bit swt. But this step logically does not make sense, still works.
Approach 2: All my swt libs for each O/S had the same name- «swt.jar» residing in different folders. I only changed to the appropriate lib when testing, i.e., 32 and 64 bit o/s both has swt.jar. Now this was somehow causing some problem. Not yet able to identify. But on changing the name to something different for each of the swt lib files, it got resolved. This step also does not make much sense.
Approach 3: I am working using geotools api version 10.5 which also contains an swt library in the bin folder. I had to remove it from the folder (move to alternate location) and now my app runs smooth!!
Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )
I’m trying to debug this problem but not sure where exactly i need to replace SWT jar file for Eclipse.
Current System Config:
Link1: Understood the cause of the problem and i tried to replace 64-bit SWT to 32 Bit but i’m not sure whether i’m doing it right ?
downloaded 32-bit file swt-3.6.1-win32-win32-x86.zip Extracted the zip file Have files as shown below
copied swt.jar file navigated to C:\Program Files\eclipse\plugins removed 64-bit Swt file ( i.e org.eclipse.swt.win32.win32.x86_64.source_3.6.2.v3659c ) placed copied swt.jar file and relaunched
Still throws SAME ERROR
also tried renaming the swt.jar file to org.eclipse.swt.win32.win32.x86_64.source_3.6.2.v3659c
Still same ERROR
Link2: Suggested the alternative solution but couldn’t resolve the problem.
Still same ERROR
I really don’t want to uninstall 32-JVM and 32-Bit Eclipse and install corresponding 64 Bit versions.
Not an OPTION
Workaround After the paulsm4 and Paul Webster response & i’m confused
When i tried executing this to check JVM, JRE version in Eclipse
However when i tried on command line for JAVA — VERSION
So my understanding system has 64bit JVM where as Eclispe is reading 32 Bit JVM. So how can i divert system to read 32 Bit JVM ?
13 Answers 13
Eclipse is launching your application with whatever JRE you defined in your launch configuration. Since you’re running the 32-bit Eclipse, you’re running/debugging against its 32-bit SWT libraries, and you’ll need to run a 32-bit JRE.
Your 64-bit JRE is, for whatever reason, your default Installed JRE.
To change this, first make sure you have a 32-bit JRE configured in the Installed JREs preference. Go to Window -> Preferences and navigate to Java -> Installed JREs:
You can click Add and navigate to your 32-bit JVM’s JAVA_HOME to add it.
Then in your Run Configuration, find your Eclipse Application and make sure the Runtime JRE is set to the 32-bit JRE you just configured:
(Note the combobox that is poorly highlighted.)
Don’t try replacing SWT jars, that will likely end poorly.
Running java in 32 bit mode on windows 64
I need to run java in 32 bit mode under windows 8.1 64 bit.
I have installed java 7 jre under c:\Program Files\Java\jre7 (64bit JVM) and under c:\Program Files (x86)\Java\jre7 (32bit JVM).
However, if from cmd I issue java -d32 -version , I get this error:
Without the -d32 switch it confirms its running the 64 bit JVM:
So I opened the java control panel and added the 32bit JVM to the user installed JRE (system tab does not allow me to change anything even if running as administrator), but nothing changes.
I’ve read some posts of users saying that with java 7+ the -d32 mode should be supported but I can’t get it.
Note: Please note that I cannot remove the 64bit JVM because I need it for other applications
5 Answers 5
According to this FAQ :
How do I select between 32 and 64-bit operation? What’s the default?
The options -d32 and -d64 have been added to the Java launcher to specify whether the program is to be run in a 32 or 64-bit environment. On Solaris these correspond to the ILP32 and LP64 data models, respectively. Since Solaris has both a 32 and 64-bit J2SE implementation contained within the same installation of Java, you can specify either version. If neither -d32 nor -d64 is specified, the default is to run in a 32-bit environment. Other Java commands (javac, javadoc, etc.) will rarely need to be executed in a 64-bit environment. However, the -d32/-d64 options may be passed to these commands and then on to the Java launcher using the established -J prefix option (eg: -J-d64).
All other platforms (Windows and Linux) contain separate 32 and 64-bit installation packages. If both packages are installed on a system, you select one or the other by adding the appropriate «bin» directory to your path. For consistency, the Java implementations on Linux accept the -d64 option.
Make sure you re using 32 bit jre if on windows
3.1. Пока осилить не могу, java ругается благим матом.
До текста на экране загрузил так:
redsn0w.exe -i iPhone3,1_5.0.1_9A405_Restore.ipsw -r i4ramdisk.dmg
Дальше пока тупик.
Пронаблюдал маты на мою платформу AMD64, что java 32 bit не особо хочет под ней пахать. Вот ломаю голову.
java -jar sshrjd.jar
SSH ramdisk maker & loader, version 25-01-2012 git rev-03
Made possible thanks to Camilo Rodrigues (@Allpluscomputer)
Including xpwn source code by the Dev Team and planetbeing
Including syringe source code by Chronic-Dev and posixninja
syringe exploits by pod2g, geohot & posixninja
Special thanks to iH8sn0w
Report bugs to msft.guy (@msft_guy)
Error: Cannot load resource res/native/jsyringeapi.dll
Error: Cannot load resource res/native/mux_redux.dll
Exception java.lang.NullPointerException
java.io.File. (Unknown Source)
java.lang.Runtime.load0(Unknown Source)
java.lang.System.load(Unknown Source)
Jsyringe.init(Jsyringe.java:44)
gui.guiInit(gui.java:192)
gui$2.run(gui.java:171)
java.awt.event.InvocationEvent.dispatch(Unknown Source)
java.awt.EventQueue.dispatchEventImpl(Unknown Source)
java.awt.EventQueue.access$200(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)
FATAL: Cannot load native libraries; make sure you’re using 32-bit JRE if on Windows!
INIT FAILED (Jsyringe)!
upd: вычитал, что с win 7 64 bit не пашет. У меня ХР и семера 64 бит. Вечером дома на «подопытном» компике поставлю 32-бит семерку. Ну задело за живое, сволочь 🙂
Добавлено через 10 часов 50 минут
Победил я эту сволочь. Для этого потребовалась win 7 32 bit, itunes 11.0.5, Java 7 и подмена jar-файла, который automatic ssh ramdisk creator, в gecko iphone tool, на последнюю версию. Итог — 6 часов секаса, но было дело принципа 🙂
У меня на ноуте на x64 наотрез отказалось работать. Какую только java не ставил.
Принес афоню домой, на пустой hdd обычного компа (проц AMD) поставил вин 7 32, и поехали.
Добавлено через 118 часов 6 минут
Не могу изменить [вопрос] на [решено].
Изменил на [решено]
А на процессорах Intel Atom это добро работает?
А то java установил , джейлбрейк сделал ( правда не с помощью Redsn0w, а с помощью друой утилиты), рекомендованный iTunes, запускаю Gecko- все нормально, но при попытке брута очень быстро пробегает строка и говорит что пасс найден, создается текстовый файл и котором нет ничего.