Troubleshoot R engine failures
When you encounter problems with jobs running, and you are using the open-source engine, you should check to make sure that the rJava package is installed and working correctly.
If your open-source R jobs fail, and your log or error messages indicate that it cannot find the rJava package, you can check the following conditions:
On Windows
Make sure the rJava package is not installed in the User directory. When you call install.packages, you must provide the installation path, as recommended in Configuring an open-source R engine.
In open-source R, you can run the following commands to discover if rJava is installed, where it is installed, and if it is installed correctly:
.find.package("rJava") system.file("jri",package="rJava")
On UNIX/LINUX
When you try to install rJava using install.packages(), you might get the following error if your Java environment for R is not property configured:
md64 -L/usr/local/lib64 -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
configure: error: Java Development Kit (JDK) is missing or not registered in R
Make sure R is configured with full Java support (including the JDK). run the following command as root to add Java support to R:
R CMD javareconf
If you do not have root privileges, run the following command to set all Java-related variables, and then install rJava.
R CMD javareconf.
If you see the following error
ERROR: configuration failed for package "rJava"
* removing "/usr/local/lib64/R/library/rJava"
"/tmp/RtmpkNWoW5/downloaded_packages"
Updating HTML index of packages in '.Library'
Warning message:
In install.packages("rJava") :
installation of package 'rJava' had non-zero exit status
run the following command:
env JAVA_HOME=/usr/java/jdk-11.0.11 ./R CMD javareconf
Where JAVA_HOME is set to the path to the installed JDK.