0
votes

I tried to find solutions from previous posts, but they do not solve my problem.

I am using macOS High Sierra and have Java installed. Below is the error reported by Rstudio. Also, rJava, Mac, and R are really messy with each other. I found this post but still does not work.

https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)

///////////////////

library(RWeka) Error: package or namespace load failed for ‘RWeka’: .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 In addition: Warning message: package ‘RWeka’ was built under R version 3.4.4

1
could you please run library(rJava) just for verification?mischva11

1 Answers

0
votes

I met the same question and I found this is helpful. Cannot load R xlsx package on Mac OS 10.11

1.In terminal enter the following to relink Java correctly:

sudo R CMD javareconf 

2.Back in R (or RStudio) install the rJava package from source:

install.packages("rJava",type='source')

Then library(rJava) and library(RWeka) should work.