Install rJava in R 3.6 with MacOSX 10.13

Instal homebrew: https://brew.sh/index_fr

In terminal:

brew install --with-toolchain llvm

in .profile, add:

PATH="/usr/local/opt/llvm/bin:${PATH}"
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS
export CPPFLAGS

Install the latest java jdk: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Look at here: https://biostatsr.blogspot.fr/2018/02/set-javahome-to-correct-value-in-profile.html

In terminal, enter:

cd $(/usr/libexec/java_home)/jre/bin/
sudo ln $(/usr/libexec/java_home)/bin/javac javac
sudo ln $(/usr/libexec/java_home)/bin/javah javah
sudo ln $(/usr/libexec/java_home)/bin/jar jar

cd $(/usr/libexec/java_home)/jre/lib/

sudo ln $(/usr/libexec/java_home)/lib/tools.jar tools.jar

cd $HOME

sudo R CMD javareconf

And in R

install.packages("rJava")

Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

Install treemix in ubuntu 20.04

stepAIC from package MASS with AICc