R/RStudio, Yosemite, and Java

前端 未结 3 1923
悲哀的现实
悲哀的现实 2021-02-19 08:26

I upgraded to OSX Yosemite yesterday. When I run library(xlsx) in RStudio, the program crashes and I get the message: \"To open \'RStudio\' you need to

3条回答
  •  长情又很酷
    2021-02-19 08:41

    I was able to get rJava loaded with Java 8. It looks like this is a problem with RStudio not passing certain environment variables into its rsession from Yosemite. Hopefully they'll fix it soon, but in the mean time you can pass the environment variable yourself in a terminal. Run this:

    $LD_LIBRARY_PATH=$(/usr/libexec/java_home)/jre/lib/server: open -a RStudio

    Basically what you're doing here is running the java_home executable, which returns your Java path, and then appending the jre/lib/server directory. This gets assigned to LD_LIBRARY_PATH, which is what RStudio needs to correctly.

提交回复
热议问题