R/RStudio, Yosemite, and Java

你说的曾经没有我的故事 提交于 2019-12-03 23:58:09

instead the java you have installed download this one

https://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US

after installing it, your problem will be solved

This worked for me: setting two env variables in ~/.profile

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/server

I can install the rJava and xlsx packages in Rstudio as such. Admittedly, though, it took hours of tinkering around (mindlessly) to get it just right.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!