Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

379
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda