Some R packages depend on Java (via the R package rJava) in order to function. This includes the packages xlsx and XLConnect, which are used to read from and write to Excel files in R. If you have installed either package and are getting an error message about JAVA_HOME when trying to load the package:
Windows users: You may need to update your version of Java, or you may need check that your version of Java has the same "bitness" (32-bit or 64-bit) as your version of R.
Mac users: Macs do not have Java installed by default, so you will need to download and install Java. (You do not have to have Excel installed in order to read and write to Excel files in R.) Your version of Java must match the "bitness" (32-bit or 64-bit) as your version of R.
All users who need to install Java can download it from java.com.
Users troubleshooting this issue in R can find helpful information at the following links:
Stack Overflow: How can I install rJava for use with 64-bit R on a 64-bit Windows computer?
Users who need to read Excel files into R (*.xls or *.xlsx) can also try the readxl package, which does not have any external dependencies; however, this package can not write data to Excel files as of this writing (August 2016).
Was this helpful? 0 0