Generate exe for 32-bit system of Java software - java

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

Related

Is there an option to specify the JRE location to be used by the installer?

We have a a Linux installer with bundled 64-bit JRE.
One user is still on Ubuntu 16 32-bit. The installer does not run (as expected):
We were wondering if we could provide a workaround to get the installer to run anyway, like a command line option for the installer to provide the JRE location to use.
We also tried installing a 32-bit JRE via apt-get and were hoping that the installer would fall back to the standard JRE search locations, but it only tries the unpacked bundled JRE.
As of install4j 9.x there is no way to do that. I've added a feature request to our issue tracker.

JET Excelsior create exe for 32 bit

I am using jet excelsior for creating an exe file from a java project.
my question is if I can configure the settings to create an exe file that will be installed on a 32 bit computer.
my computer is 64 bit and if I create the exe in it using jet excelsior version 12, the created exe file is failing to be installed on a 32 bit computer.
can someone help me figure this?
There are 2 variants of Excelsior JET distributions. If you want a 32-bit compatible binary you should build with 32-bit distribution
This is info from 32 bit vs 64 bit section of their evaluation page:
Which version to evaluate: 32‑bit or 64‑bit?
As of version 12.0, 32‑bit Excelsior JET provides more features (see Release Notes below), and often delivers better application performance, but the final choice depends on your target platform(s):
Windows: 32‑bit executables install and work normally on 64‑bit Windows systems, so if Windows is your sole target, evaluate the 64‑bit version only if your application requires a large heap and/or needs to integrate with 64‑bit native libraries.
Linux: Installation of 32‑bit libraries on 64‑bit Linuces is often cumbersome, so you may need to provide both 64‑bit and 32‑bit Linux builds to your end users.
OS X: The OS X version of Excelsior JET is 64‑bit only, so you don't really have a choice.

compile a 32 bit JAR file in 64 bit Ubuntu in netbeans

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.

Launch4j only 32-bit wrapper?

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?

Can't load AMD 64-bit .dll on a IA 32-bit platform

I download the Gurobi package for linear programming. I import the corresponding gurobi.jar package. Then run the example program. Then it appears the following errors:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\gurobi460\win64\win64\bin\GurobiJni46.dll: Can't load AMD 64-bit
.dll on a IA 32-bit platform
Then I downloaded the window 64 bit Jre, and use the "window-->preference-->Installed JRE" to install this new JRE.
However, it still appeared this error.
If you are still getting that error after installing the 64 bit JRE, it means that the JVM running Gurobi package is still using the 32 bit JRE.
Check that you have updated the PATH and JAVA_HOME globally and in the command shell that you are using. (Maybe you just need to exit and restart it.)
Check that your command shell runs the right version of Java by running "java -version" and checking that it says it is a 64bit JRE.
If you are launching the example via a wrapper script / batch file, make sure that the script is using the right JRE. Modify as required ...
If you are launching the example via an IDE, check that the IDE is using the right JRE to launch. Check and modify the IDE configs. The details will depend on the IDE you are using. Check the documentation. (Just setting external environment variables such as JAVA_HOME may not be sufficient in this case.)
Try this:
Download and install a 32-bit JDK.
Go to eclipse click on your project (Run As → Run Configurations...) under Java Application branch.
Go to the JRE tab and select Alternate JRE. Click on Installed JRE button, add your 32-bit JRE and select.
Uninstall(delete) this: jre, jdk, eclipse.
Download 32 bit(x86) version of this programs:jre, jdk, eclipse.
And install it.

Categories