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.

Note: Packages are not cross-platform compatible. The package developer must build the package specifically for each platform. In the case ofopen-source R binary packages, the developer must use an open-source R engine configured with the option –-enable-R-shlib enabled.
Note: Open-source R is available under separate open source software license terms and is not part of TERR. As such, open-source R is not within the scope of your license for TERR. Open-source R is not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of open-source R is solely at your own discretion and subject to the free open source license terms applicable to open-source R.

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.