Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

378
Views
Java SDK Reporting Wrong Architecture on Mac M1

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
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Its probably because you're actually running a x86_64 Java VM through Rosetta on your M1 Macbook. At least AdoptOpenJDK doesn't even offer a native m1 version of Java 11. For Java 17, there is a native aarch64 version available: https://adoptium.net/releases.html?variant=openjdk17&jvmVariant=hotspot

In the Activity Monitor app bundled with your map, you can verify if an app (“process”) is running natively versus running under Rosetta 2. Find your process, likely named java, and look at the Kind column. Native apps say Apple while apps under Rosetta 2 say Intel.

enter image description here

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!