I have a need to alternate between and x86 zulu java build and the arm build. Is there a way to do this? I am running on an apple M1. I've set my terminal to open using rosetta I have the config set to true for sdkman. I've then installed the zulu 21 but I still see the arm version. Is this not possible anymore with sdkman? I've found this article but it doesn't seem to work for me. Any suggestions are appreciated.
% cat ~/.sdkman/etc/config
sdkman_auto_answer=false
sdkman_auto_complete=true
sdkman_auto_env=false
sdkman_beta_channel=false
sdkman_checksum_enable=true
sdkman_colour_enable=true
sdkman_curl_connect_timeout=7
sdkman_curl_max_time=10
sdkman_debug_mode=false
sdkman_insecure_ssl=false
sdkman_rosetta2_compatible=true
sdkman_selfupdate_feature=true
% cat `which java` | file -
/dev/stdin: Mach-O 64-bit executable arm64
~ % java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment Zulu21.28+85-CA (build 21+35)
OpenJDK 64-Bit Server VM Zulu21.28+85-CA (build 21+35, mixed mode, sharing)
I haven't looked at the git history, but right now there is no reference to sdkman_rosetta2_compatible within the code, so it must have been dropped as it was temporary from what that article alludes to.
Interestingly enough, I did see the env SDKMAN_PLATFORM in there being used when downloading SDKs, which is actually being set in ~/.sdkman/var/platform and has a value of darwinarm64 (on m1). With that env I am able to list and install x86 SDKs on my m1 with the below:
SDKMAN_PLATFORM=darwin sdk list java
SDKMAN_PLATFORM=darwin sdk install java 11.0.9-zulu
sdk use java 11.0.9-zulu
cat `which java` | file -
Which will output the following
/dev/stdin: Mach-O 64-bit executable x86_64
If that doesn't work then try flushing the cache (sdk flush tmp) and then try again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With