Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

384
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda