cannot use rJava

I'm trying to load rJava but got the following error:

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 '/Users/Rachelcookies/Library/R/3.4/library/rJava/libs/':
dlopen(/Users/Rachelcookies/Library/R/3.4/library/rJava/libs/, 6): Library not loaded: @rpath/libjvm.dylib
Referenced from: /Users/Rachelcookies/Library/R/3.4/library/rJava/libs/
Reason: image not found

I followed zhiyzuo's solution but was stuck at the java version step. I installed jenv but still got the Java version as 11.

Could anyone give my any advice? Thanks a ton!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.