5

I am creating a JAVA desktop app for Mac computers, using jpackage to bundle the desired JRE into the app and finally shipping a .app to the customers.

With the new m1 apple arm silicon computers I do not want to create different apps for each processor architecture with the right JRE (intel & arm) but create one single universal binary app that launches the Intel JRE on Intel computers and the Arm JRE on Arm computers. I know this is possible somehow.

I tried to create two .apps and use the lipo tool from the mac command line, but this doesn't really work.

Any suggestions how to proceed?

trainrobbery
  • 500
  • 3
  • 14

1 Answers1

1

I took the Zulu Intel and arm JRE (not JDK) builds and lipo'ed the binaries. You can run the script using your generated JRE bundle (you would just need to run jpackage on an Intel and ARM computer to get the appropriate runtimes for each architecture ).

Github repo:

https://github.com/ChristopherBruno78/universal_jre

Tested on intel and arm macOS 13 Ventura.

  • 1
    Hi, Can you provide some details how you did this? I'm using jpackage too. I'm creating a runtime image first using jlink and this runtime image is used with jpackage. – Klaus Friese Jun 16 '22 at 12:36
  • 1
    I created a git repo with the script I used: https://github.com/ChristopherBruno78/universal_jre – Christopher Bruno Mar 05 '23 at 07:54