Because on Apple with M1, M2 ... (Apple Silicon) it is possible to install both JDK for arm (aka arm64) or for Intel CPU (aka amd64), and it will just work, there is problem to tell (to colleague on other mac) how to check
How to check that installed JDK on mac is for arm64 or amd64 ?
- From command line?
- From within Java program? (not the OS arch
System.getProperty("os.arch")
)
For example mvn -v
used to be enough to tell all details.
mvn -v
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /opt/homebrew/Cellar/maven/3.9.1/libexec
Java version: 17.0.6, vendor: Amazon.com Inc., runtime: /Users/user/Library/Java/JavaVirtualMachines/corretto-17.0.6-1/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "13.4", arch: "aarch64", family: "mac"
JDK java/javac don't give clue either.
javac -version
javac 17.0.6
java -version
openjdk version "17.0.6" 2023-01-17 LTS
OpenJDK Runtime Environment Corretto-17.0.6.10.1 (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.6.10.1 (build 17.0.6+10-LTS, mixed mode, sharing)
We also have JDK installed by scripts, JDK installed in docker container. There should be some common way to check.