Things under legendu
The most convenient way is to install the corresponding Linux package if exists.
sudo apt-get install r-cran-rjavaHowever, this Linux package is often outdated. Follow the steps below if you’d rather install rJava manually.
Install OpenJDK and configure Java.
sudo apt-get install openjdk-7-* sudo R CMD javareconfInstall the
rJavapackage in R.install.packages("rJava").
If it does not work,
please set the JAVA_HOME environment variable manually in step 1
and then try step 2 again.
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre