I have a strange java issue. I'm working on a MacBook Air and doing some Java development work. I need my code to do the following:
// pseudo code
if (intel) {
// Load docker
} else if (arm) {
// Load ARM docker
}
It works for Intel and Linux-based ARM architecture. But for my M1 MacBook Air, it reports that the OS is Mac OS X but the architecture is reported as x86. Because of that last issue, I can't distinguish between the ARM and Intel machines.
Here's the JDK version I'm running. I feel like I'm missing something here, but is there some way I can write this code so that I can determine whether the code is running on an M1 or an Intel?
~ java --version
openjdk 11.0.12 2021-07-20 LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM Zulu11.50+19-CA (build 11.0.12+7-LTS, mixed mode)
(base) ➜ ~ java -XshowSettings 2>&1 | grep " os."
os.arch = x86_64
os.name = Mac OS X
os.version = 11.5
