-2
> library('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

I installed JDK9 version on my Macbook Pro

My OS is 10.12.6 Sierra

I tried to activate rJava many times.

I searched Google a lot.. but I could not solve that problem..

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
이영훈
  • 11
  • 2
  • 2
    Try the solution described here: https://github.com/snowflakedb/dplyr-snowflakedb/wiki/Configuring-R-rJava-RJDBC-on-Mac-OS-X — Disclaimer: I have no idea whether this is related to your problem, or if it will work. Short version: after installing Java, run `R CMD javareconf` in the command line, *then* reinstall the `rJava` package from source. – Konrad Rudolph Oct 26 '17 at 08:33
  • Have you looked and followed advice [here](https://stackoverflow.com/questions/30738974/rjava-load-error-in-rstudio-r-after-upgrading-to-osx-yosemite) and [here](https://stackoverflow.com/questions/44081227/trouble-installing-and-loading-rjava-on-mac-el-capitan)? – Maurits Evers Oct 26 '17 at 08:34
  • Take a look here: http://www.owsiak.org/?p=3718 – Oo.oO Oct 27 '17 at 10:25

1 Answers1

0

There are numerous issues you may find here.

  • incorrect rJava package
  • issues with JVM configuration
  • problems related to package sources (you need most recent release of clang to compile most recent version of rJava)
  • there are issues with R and it's configuration utility for JVM configuration.

In general, there is no easy solution you can apply for each and every environment. Take a look here:

http://www.owsiak.org/r-3-4-rjava-macos-and-even-more-mess/

I have collected sources of most of the issues you can find while working with JVM and R. Also, pay attention to JDK 9 - it no longer comes with JRE. In past, JRE was internal part of JDK.

In general, I don't think you can solve this issue without, at least, little bit of work.

For all the helping people with comments: "This link may provide ...". Just take a look at the content and you will know why I don't copy-paste it here ;)

Oo.oO
  • 12,464
  • 3
  • 23
  • 45