Unable to use package rJava on Macbook with Apple M1 Chip, Get the error below

Viewed 679
> library(rJava)
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/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib':
  dlopen(/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib, 10): no suitable image found.  Did find:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib: mach-o, but wrong architecture
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib: mach-o, but wrong architecture

Please note: I have the Java installed from https://www.oracle.com/java/technologies/downloads/#java8-mac and when asked, I allowed it use the Rosetta way.

Has anyone been able to make this work? Can you please help. I need rJava on Mac with M1 Chip.

1 Answers

OK. rJava on M1 will only work with JDK 17 aarch64 version. Since that has native support.

Related