3
> 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.

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
guna
  • 1,148
  • 1
  • 10
  • 18

2 Answers2

2

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

guna
  • 1,148
  • 1
  • 10
  • 18
0

error: unable to load shared object '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib':

Quite stupid, but finding the '/Library/Internet Plug-Ins' folder and removing the space in the folder name fixed it for me. So change the folder name from '/Library/Internet Plug-Ins' into '/Library/InternetPlug-Ins'. Hope this helps!

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 26 '23 at 05:22