2017-07-27 168 views
0

我正在使用macOS Sierra和R版本3.4.0。 我安裝使用RStudio包 「rJava」:rJava無法在macOS上運行Sierra

install.packages("rJava") 
Warning in install.packages : 
    cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/PACKAGES.rds': HTTP status was '404 Not Found' 
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rJava_0.9-8.tgz' 
Content type 'application/x-gzip' length 627959 bytes (613 KB) 
================================================== 
downloaded 613 KB 


The downloaded binary packages are in 
    /var/folders/tq/f5jbfqp97y52w_y7byn05_fw0000gn/T//RtmpTdEVbA/downloaded_packages 

然後,當我嘗試運行rJava我得到:

> require(rJava) 
Loading required package: rJava 
Error: package or namespace load failed for ‘rJava’: 
.onLoad failed in loadNamespace() for 'rJava', details: 
    call: dyn.load(file, DLLpath = DLLpath, ...) 
    error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so': 
    dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib 
    Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so 
    Reason: image not found 
+1

不,我想用rJava來運行RNetLogo。 – sbac

+0

看看是否在終端中執行'R CMD javareconf'解決了這個問題。 – Bhas

+0

是的,我之前嘗試過,現在又一次,沒有任何運氣。 – sbac

回答

0

R,rJava和Java是在MacOS上有點凌亂。一般來說,您必須確保正確配置所有元素。 Oracle和Apple的版本之間有衝突。

看看這裏非常詳細的說明:R, Java, rJava and macOS adventures

我不要在這裏發佈的內容 - 這是相當長的。

相關問題