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?
I took the Zulu Intel and arm JRE (not JDK) builds and lipo'ed the binaries. You can download JRE 17 universal here:
https://www.hokuasoftware.com/jre/zulu-17-universal.zip
Tested on intel and arm macOS 11 Big Sur.
Related
enter image description hereim trying to install JDK 17.0.1 and I don't have any java installed in my computer like other versions of JDK and java runtime. Im using macOS Monterey. my CPU is I5 and I have a Mac book 2020 and 13 inches.
more info:
MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
processer: 2 GHz Quad-Core Intel Core i5
memory: 16 GB 3733 MHz LPDDR4X
Graphics: Intel Iris Plus Graphics 1536 MB
In my case, I downloaded the Arm 64 DMG Installer, the architecture of which does not work on my mac. Downloading the x64 DMG Installer (the final option) was the right choice.
tl;dr
Use an installer for Intel Macs rather than Apple Silicon Macs.
Obtain installer for Macs with Intel chips
Certainly Java 17 will run on your computer.
I am not sure, but I would make this guess as to the root of your problem… I suspect you downloaded an installer for the Apple Silicon Macs, rather than for Macs with Intel chips.
Go to any of the several vendors providing JDK products. Some are free-of-cost, some require a fee. Be sure to understand their terms before downloading.
Those vendors include, off the top of my head: Azul Systems, Adoptium (formerly AdoptOpenJDK), BellSoft, Amazon, Red Hat/IBM, Microsoft, Oracle, SAP, Pivotal, and likely more.
On their respective download page, be sure to opt for the edition labeled "Intel", "x86", "AMD-64", or some such to indicate Macs with Intel chips.
Do not download any edition labeled "Apple Silicon", "ARM", or "AArch-64", as these indicate the Macs with M1 chips.
Here is an example screenshot from Adoptium web site for their Temurin product, an installer of a JDK implementing Java 17 based on the source code at the OpenJDK project.
Using package managers simplifies your experience as you can get anything from one place. Moreover, vendors support packages at such systems. I prefer SDKMAN!
Try to use SDKMAN https://sdkman.io. For example, you can install Liberica JDK 17 on MacBook Pro with X86 or M1 processors, and you do not have to care SDKMAN will select the right package for you.
Download and install SDKMAN!:
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
Get the list of available Java distributions to install:
$ sdk list java
For example, to install Liberica JDK 17:
$ sdk install java 17.0.1-librca
or with Java FX
$ sdk install java 17.0.1.fx-librca
Check a short document about other package managers and how to use them for Liberica JDK installation.
https://bell-sw.com/pages/package-managers/#sdkman
I've made an application using Java 17 with JavaFX 16 library. Is there a way to make an installable 32-bit version using JPackage of it? Since Java comes always just in 64-bit since Java 9 (same with JavaFX library), I doubt it's not possible, but is there any way to do it?
Yes, you can make an installable 32-bit version of a JavaFX app using jpackage (Java 17).
Azul Zulu provide 32 bit JDK+JavaFX 17 downloads for various platforms. Switch your app to use that and package it using that JDK. When doing so, (I think) it won't be necessary to supply JavaFX Maven dependencies as the JavaFX modules will already be available from the Azul JDK+JavaFX platform distribution.
I won't supply the full steps on how to use jpackage here, as that is documented and discussed elsewhere.
From comments by the original poster, this method worked:
Azul JDK worked perfectly in windows (I'm using windows, and my client (who has 32 bit OS) also uses windows)
OR
JavaFX packages in Maven central are available for various OS and 32-bit or 64-bit platform architectures.
You can select from a specific architecture (or combination of architectures) as a dependency in Maven using a classifier, similar to this example (without the shading).
If you go that route, you need to make sure that you choose the appropriate underlying JDK correctly when doing the packaging (choose a 32-bit JDK build rather than a 64-bit JDK build). Again, Azure Zulu (and possibly other JDK vendors) provide 32-bit JDK builds that you can use.
If a Mac is your target device, Mac OS X does not support 32-bit apps, hence there are no 32 bit Java/JavaFX builds for Mac, only 64 bit builds targeting either Intel chips or the new Apple M1 chips.
Examples of supported architectures for which there are binary JavaFX builds. This is based just on a quick look at the classifier extensions available for binary jars in the JavaFX Maven repository. The comments are just my guesses on what these are, not official documentation:
linux-aarch64 (linux arm v8 64 bit).
linux-arm32 (linux arm v7 32 bit).
linux (linux intel 64 bit).
mac-aarch64 (mac M1 64 bit).
mac (mac intel 64 bit).
win-x86 (win intel 32 bit).
win (win intel 64 bit).
If no classifier is provided, I think the build will examine your current operating environment and choose the best fit.
In addition for some platforms, there are builds with the -monocle suffix in the classifier, also available in 32 bit and 64 bit flavors for various OS types. This is targeted to embedded devices, or headless (no display, e.g. a server) and provides a version of JavaFX that does not use an OS-provided windowing system (i.e. windows are managed purely by JavaFX, not an X-windows window manager and not the Windows OS window manager) and may use Software rendering rather than Hardware rendering. Most people won't need this, but if interested see the (minimal) Monocle documentation.
Gluon provides JavaFX support for various mobile architectures via Gluon Mobile. I believe it is different from a jpackage solution and instead relies on native compilation using GraalVM (but I could be wrong, I haven't investigated it). Regardless of how it works, if you need to target a mobile device for a JavaFX deployment, I advise that you check with Gluon and their mobile development, packaging and deployment solutions.
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.
I want to install JAVA from the link:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I am using Windows 7 (32 Bit OS) in Dell Vostro Laptop with Intel Core i5 2.50 GHz
Now in the link, there are 2 installations for Windows:
Windows x86 161.08 MB jdk-8u20-windows-i586.exe
Windows x64 173.08 MB jdk-8u20-windows-x64.exe
Which one I had to select to install JAVA 8?
Windows x86 161.08 MB jdk-8u20-windows-i586. You cannot run 64bit applications on a 32bit Operating System. You have no choice but to go with 32bit (x86)
You will need to run Windows x86 161.08 MB jdk-8u20-windows-i586.exe unless your computer has a minimum of 4GB of RAM... Also you will need to look at this other post of mine to setup your environment variables in Windows. https://stackoverflow.com/a/22368507/3250752. Your environment variables need to be setup if you intend to use the command prompt or CMD in Windows to compile your applications and run them....
I need to port a java desktop app for mac os-x.
The app will be launched via JNLP.
Is the Java runtime environment pre-installed on MAC-OSX ?
In general. Java 5 or Java 6 was preinstalled on Mac OS X up to 10.6, but this ceased in 10.7.
Besides, a recent Mac OSX update uninstalls the version of Java 6 plugin previously supported by Apple. Apple have never supported Java 7.
https://blogs.oracle.com/thejavatutorials/entry/apple_s_java_mac_os
You (or your users) need to download and install Java 7 for the Mac from Oracle. But #Andrew Thompson's comment (see above) offers a good way to smooth that "speed bump".