Struggling with rJava and dependent packages in Rstudio Mac M1. Error: package or namespace load failed for ‘rJava’:

huangapple go评论79阅读模式
英文:

Struggling with rJava and dependent packages in Rstudio Mac M1. Error: package or namespace load failed for ‘rJava’:

问题

我真的在处理rJava方面遇到了困难。我有一台新的机器(Mac M1),正在运行一个旧的英特尔Mac上的旧r代码项目,但它根本不起作用。我对这个不太熟悉,也不太自信,也不太熟悉终端操作,所以请在回答时考虑到这一点:)

我得到的错误消息是:

 .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, 0x000A): tried: ‘/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib’(mach-o文件,但是架构不兼容(已经是‘x86_64’,需要‘arm64’)),‘/System/Volumes/Preboot/Cryptexes/OS/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib’(没有这个文件),‘/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib’(mach-o文件,但是架构不兼容(已经是‘x86_64’,需要‘arm64’))
我认为一个问题是,如果我运行
$/usr/libexec/java_home /usr/libexec/java_home /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 

它认为Java不在正确的位置?

我尝试通过以下方式纠正这个问题:

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
但似乎没有任何改变。

非常感谢任何建议。

英文:

I'm really struggling with rJava. I have a new machine (Mac M1) and am running r code from an older project on an old intel Mac, and it isn't working at all. I am not especially familiar or confident with this, or using the terminal so please bare this in mind when answering Struggling with rJava and dependent packages in Rstudio Mac M1. Error: package or namespace load failed for ‘rJava’:

The error message I am getting is:

 .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, 0x000A): tried: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (no such file), '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
I think one issue is that if I run
$/usr/libexec/java_home /usr/libexec/java_home /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 

It thinks java is not in the right place?

I tried to rectify this by doing:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
but it doesn't seem to make a difference.

Grateful for any advice

答案1

得分: 0

这已通过下载Azul进行了纠正,链接为https://www.azul.com/core-post-download/?endpoint=zulu&uuid=cf6e06ec-c897-4b5a-9859-e1c547ff5864。

英文:

This was rectified by downloading Azul https://www.azul.com/core-post-download/?endpoint=zulu&uuid=cf6e06ec-c897-4b5a-9859-e1c547ff5864

huangapple
  • 本文由 发表于 2023年7月7日 01:44:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76631341.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定