Commit graph

1 commit

Author SHA1 Message Date
2ee7dcd7a0
feat: Script for SDKMAN! java setup on macOS
macOS find JAVA_HOME differently than other OS for some reason, and it
doesn't seems to be documented either, but basically macOS will detect
latest JVM(Platform) in "/Library/Java/JavaVirtualMachines" (or
"~/Library/Java/JavaVirtualMachines"). To do detect the version they
look up Info.plist in "<java-distro>/Contents", if it's the newest it
then print the "Home" dir path of that distro.
(e.g. "/Users/<user>/Library/Java/JavaVirtualMachines/zulu-13.0.0/Contents/Home")

Not sure why SDKMAN! didn't handle this themselves, but whatever. This
solve my issue when trying to run KMM iOS App

REF: https://stackoverflow.com/questions/76523553/how-to-make-usr-libexec-java-home-find-jdk-installed-using-sdkman-on-macos
2024-07-08 12:55:03 +07:00