Sdkman-cli: Feature: SDKMAN to offer the possibility to install Native JDK for Apple Silicon

Created on 29 Nov 2020  路  7Comments  路  Source: sdkman/sdkman-cli

Now that Apple Silicon computers are publicly available, and there is the first native JDK for this CPU architecture from Azul https://www.azul.com/downloads/zulu-community/?package=jdk, it would awesome that I could install it using SDKMAN.

enhancement

Most helpful comment

@marc0der I have a MBP with M1 I tried the two commands and here is the output :
For uname I get Darwin
And for uname -m I get arm64

All 7 comments

@imrabti I totally agree, it will be fantastic to have this platform covered. Some work needs to be done on the CLI to accommodate this. We use the output of uname and uname -m to infer the architecture of a platform on SDKMAN. If you perhaps have such a machine available, please help us by providing the output of those two commands.

@marc0der I have a MBP with M1 I tried the two commands and here is the output :
For uname I get Darwin
And for uname -m I get arm64

Does anyone know what a normal Mac reports for uname -m? I'm guessing that uname also returns Darwin. Apologies, I'm a Linux user :smile:

Hi @marc0der ,
On normal(Intel) mac, uname returns Darwin and uname -m returns x86_64 .

Hi all!
Is there an update on this?

Should be doable by adding a similar check for DarwinARM64 here: https://github.com/sdkman/sdkman-cli/blob/b8b856f4a589e2447dae8c7ce7fe234a982a5d26/src/main/bash/sdkman-init.sh#L34

However, with Rosetta 2, the x86_64 JDKs will run just fine. From a design point of view, if DarwinARM64 is added, should it be possible to also list/install x86_64 candidates?

The available candidates would be,

  • Darwin -> x86_64 jdks
  • DarwinARM64 -> x86_64 AND arm64 jdks

Or maybe just ask the user to set SDKMAN_PLATFORM="Darwin" specifically to install x86_64 JDKs?

If it helps, this is the output from macOS Arm64 Zulu JDK by Azul:

System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.arch"));
Mac OS X aarch64
Was this page helpful?
0 / 5 - 0 ratings

Related issues

edmondo1984 picture edmondo1984  路  6Comments

andvgal picture andvgal  路  7Comments

ilopmar picture ilopmar  路  5Comments

OmidTahouri picture OmidTahouri  路  7Comments

EarthCitizen picture EarthCitizen  路  3Comments