# error: JAVA_HOME cannot be determined from the Registry onLoad failed in loadNamespace() for 'rJava', details: Install.packages("xlsx") # Install & load xlsx onLoad failed in loadNamespace() for 'rJava', details: # call: fun(libname, pkgname) # error: JAVA_HOME cannot be determined from the Registry # Failed with error: 'package 'rJava' could not be loaded' Library ( "xlsx" ) # Loading required package: xlsx # Loading required package: xlsxjars # Loading required package: rJava # Error. It allows to create objects call methods and access fields of Java objects from R. More information can be found on Oracle's website. In order to use the xlsx package, you will need to: Ensure you have a jdk (Java Development Kit, version > 1.5) installed for your Operating System. # Failed with error: 'package 'rJava' could not be loaded'Īs you can see, the error “JAVA_HOME cannot be determined from the Registry” was returned to the RStudio console after installing and loading the xlsx package. This package depends on Java and the rJava package to make the connection between R and Java seamless. sudo apt-get install -y default-jre Install the Java Development Kit (JDK). Install the Java Runtime Environment (JRE). However, this problem does not occur because of the xlsx package, but because of the rJava package. Installing the rJava package on Ubuntu is not quite as simple as most other R packages. So why does the error message “JAVA_HOME cannot be determined from the Registry” occur when we are trying to install the rJava package? R tries to install the rJava package as well, when we are installing the xlsx package. EDIT 1 Following the link provided in the comments below, I managed to get the latest version of Java JDK running through rJava in RStudio.
The reason for this usually is that you are using a 64-bit version of R, but not a 64-bit version of Java. I've clearly missed the rJava instructions somewhere which lays out how to install the package on all computer setups. You may have installed a 32-bit version of Java or you might not have installed Java at all.
Note that the Java download page suggests the 32-bit version by default. Hence, it is necessary to manually install the 64-bit version.Įxample 2: Fixing the Error: JAVA_HOME cannot be determined from the Registry removing ‘/lib64/Revo-7.3/R-3.1.1/lib64/R/library/RHive’ Solution: Install rJava Problems: Make sure you have Java Development Kit installed and correctly registered in R. If in doubt, re-run 'R CMD javareconf' as root. ERROR: configuration failed for package ‘rJava’ removing ‘/lib64/Revo-7.3/R-3.1. In this example, I’ll explain how to solve the problems when trying load an R package due to rJava.įor this, you have to download and install the 64-bit version of Java on this page: Download Java 64-bit version for Windows. Classes 'jfloat', 'jlong', 'jbyte' and 'jchar' specify Java native types that are not native in R. Class 'jclassName' - a representation of a Java class name.
#Issue with installing rjava in r studio how to# Converts java objects or arrays to R lists.