I wrapped my jar file successfully by launch4j and bundled it with the 64-bit JRE because I'm working on Windows 10 64-bit. The program starts without any problems - so far so well.
But I'm wondering a bit because if I look in the task manager I will see "MyProgramName (32-bit)". So launch4j only creates 32-bit exe? Makes it then sense to bundle with 64-bit JRE if the launcher is only 32-bit?
Related
I have built a Java Swing application using Netbeans. I am able to generate a exe for 64-bit systems and it is working perfectly. But I am unable to generate exe for 32-bit systems because I am using a 64-bit system. So what can I do to generate the respective 32-bit exe?
There is an answer for JDK 1.8 here: create 32 bit using 64 bit netbeans javapackager
First you have to install the 32-bit JDK and JRE besides the 64-bit ones, in order to allow the IDE to give 32-bit as an option. (If that's what you want)
Install 32 bit jdk and jre
In netbeans project add a new platform and choose the 32 bit version (restart pc)
Install inno and set path.
run javapackager specifing the 32 bit i.e javapackager -deploy -native exe -B systemWide=true -Bruntime="C:\Program Files (x86)\Java\jdk1.8.0_111\jre" -Bshort cutHint=true -outdir packages
...etc
test with Exe64bitDetector
Another option is to use Launch4j: http://launch4j.sourceforge.net/
https://github.com/fabnicolas/launch4j_exe_tutorial
I exported Processing application as a standalone application with embedded Java, but the exe does not work in computers where Java/Processing is not installed. Even if the Windows 64 bits works with Java embedded, the 32 bits does not work with Java embedded or not. The computers that do not have Java already installed open the Windows 64 bits exe but not the Windows 32 exe (with java embedded in its exporting process). Here's the post in Processing forum: https://forum.processing.org/two/discussion/25373/no-export#latest
Can it be resolved? Thanks.
You can only include the Java version for the type of machine you're running on.
If you're on a 64-bit Windows machine, then you can only include Java in the 64-bit Windows application. If you're on a 32-bit Linux machine, then you can only include Java in the 32-bit Linux application.
If you really want to include Java for a bunch of different machines, then your best bet is to find each type of machine and do the export from them. Find a 32-bit Windows machine and do the export there, then find a 64-bit Linux machine and do the export there, etc.
You might be able to hack something together by downloading the JRE for each type of machine and manually including it, but that might get pretty tricky. Note that this is not as simple as just copying a folder into your application directory. You're going to have to change the run script file as well.
Shameless self-promotion: I've written a tutorial on exporting applications from Processing available here.
I just create a simple GUI java program in my ubuntu. I want to make JAR file from my ubuntu that can be executed on a 32 bit or a 64 bit windows. I have java8 installed in my ubuntu and i'm using netbeans as an IDE. is it really possible to compile a 32 bit jar file in a 64 bit OS.?
Compiled java class files are platform independent, so they will run on both x32 and x64 machines. The JVM is the one that defines used architecture.
Jar files have no 32-bit or 64-bit distinction. The JRE that runs them can be 32-bit or 64-bit, but that has nothing to do with the Java bytecode.
If you're not using any native code, then your jar file will work just fine on both platforms.
I have created .exe file using Native Packaging, using Inno (http://www.jrsoftware.org/isdl.php).
NetBeans is installed on Windows 64-bit.
The .exe file runs on machine with same OS(64-bit), but when deployed doesn't run on 32-bit OS.
For the above issue, I copied the program from 64-bit Windows to 32-bit Windows and generated EXE using Netbeans on 32-bit Windows and then installed it on 32-bit system.
I have a java webstart program, it runs on xp, osx, vista, and windows 7.
I just tried to run it on windows 7 64bit and it is having a problem loading a library.
On this win7x64 machine I have the 64bit jdk/jre and the library it is not loading is swt-win32.dll. Yeah it's 32bit, but I'm getting:
Exception in thread "Thread-10" java.lang.UnsatisfiedLinkError: no swt-win32-3325 or swt-win32 in swt.library.path, java.libary.path or the jar file...
I have tried putting the dll on the java.library.path (physically copying it to the folder) and still get the exact same error. So am I getting this error because it's a 32bit dll or because it actually just can't find it? can the 64bit jdk/jre load/use 32bit dll's or do I need to either find the 64bit version of the dll or run the 32bit jdk/jre?
You have the answer already. 64-bit DLL's require the 64-bit JDK and 32-bit DLL's require the 32-bit JDK.
swt-win32.dll is actually a SWT UI framework(eclipse) dll. Try putting it in a directory which is in your system path.
If that doesn't work, then your next best bet would be to get the SWT binaries for 64 bit windows here. I think it works for windows Vista 64. There is no mention of windows 7 but it "should" work.