1

Does anybody know if there is a possibility to install and use the rJava package in R when having the following configuration:

  • MacBookPro with M1X processor,
  • macOs 12.1 Monterrey,
  • Java11, build Azul Zulu 11.0.13+8
  • R 4.1.2?

After installation from CRAN, an attempt to load rJava results in the following error:

Error: package or namespace load failed for 'rJava':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(jli, FALSE)
  error: unable to load shared object '/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/jli/libjli.dylib':
  dlopen(/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/jli/libjli.dylib, 0x000A): tried: '/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libjli.dylib' (no such file)

Thank you very much for your help! Tomek

1 Answers1

1

You are running Intel R on M1 machine in emulation.

Install native arm64 R instead (the R-4.1.2-arm64.pkg download from CRAN).

Simon Urbanek
  • 13,842
  • 45
  • 45