I am trying to install rJava package for running the XLConnect package. Here are my system details;
R studio:Version 1.0.153
Mac OS High Sierra Version 10.13.1 (17B1003)
R version: 3.4.2
jdk-9.0.1
however, i get the following error:
I have already followed the following threads on this topic but they don't work for me:
trouble installing and loading rJava on mac El Capitan
rJava does not run on macOS Sierra
rJava load error in RStudio/R after "upgrading" to OSX Yosemite
A push in the right direction will be greatly appreciated !!
My environment is
I encountered this problem today and spent whole day trying to fix it. Luckily I found the solution at last. It works for me.
Note:sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
If the get
ln: /usr/local/lib/libjvm.dylib: File exists
in terminal. Then you should delete this file and run the command above again.@Kayle Sawyer's answer works almost perfectly, but you might need to reinstall command line tools first. Easiest way is to run the following in Terminal:
If you get an error saying command line tools are already installed, you can reinstall the package with this:
You might need to update the second command based on your OS version.
Answers from https://github.com/frida/frida/issues/338
I used the procedure at the following website: https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)
The main steps are:
sudo R CMD javareconf
unset JAVA_HOME; R --quiet -e 'install.packages("rJava", type="source", repos="http://cran.us.r-project.org")'