rJava load error in RStudio/R after “upgrading” to OSX Yosemite

前端 未结 18 1793
Happy的楠姐
Happy的楠姐 2020-11-22 04:23

I recently \"upgraded\" from OSX Mountain Lion to Yosemite and from R 3.1.3 to 3.2. Immediately after the upgrade, when I opened R or RStudio I got a pop-up message saying t

18条回答
  •  广开言路
    2020-11-22 05:17

    Here what worked for me on MAC:

    1. in your ~/.profile or ~/.bashrc add this line: %export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home

      1.1 % source .profile (or % source .bashrc)

    2. % sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
    3. remove.packages(rJava)
    4. remove.packages(Rweka)
    5. From the terminal enter this command: %sudo R CMD javareconf
    6. install.packages("rJava", dependencies = TRUE, type = "source")
    7. install.packages("rJava", dependencies = TRUE, type = "source")
    8. Load your library("rJava", "RWeka")

    Best of luck.

提交回复
热议问题