简体   繁体   中英

How can i run my exe Java application on both 32-bit and 64-bit systems?

I have compiled my java application with JDK 64-bit on windows, then i packaged the JAR file using Excelsior Jet 11.3 (64-bit) to give me an elegant exe executable ready to use by end users running windows.

The exe file works just fine on my machine (Windows 7 64-bit) but when i deployed to other 32-bit systems (windows xp & windows 7), it does not work, it shows the error message saying that the exe is not recognized as a valid 32-bit program.

How can i solve this?

How can i solve this?

Well, the standard ways of distributing Java (JAR files, WebStart, etc) avoid this because bytecodes are platform independent. You have deliberately chosen to distribute EXE files, which are inherently platform specific.

If you want to stick with EXEs can think of two alternatives:

  • Build and distribute a different EXE for each of the OS + hardware platform combinations that you need to support. (32 Windows, 64 bit Windows, various MacOS, Linux on Intel, Linux on ARM, Solaris, etc)

  • Pick a lowest common denominator; eg a 32 bit Windows EXE should be runnable on a 64 bit Windows OS.


But I would recommend either getting the user to install a JRE, or providing an installer that installed an embedded JRE.

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