0

I'm still a newbie when it comes to programming in general, so when I came across this error message when installing the package "xlsx".

I'm completely lost here, I've tried going to the Java website to download the latest version but that didn't help as far as I could tell.

I'm terrible at solving programming issues, but I need this for work. I'm running R Studio version 1.2.5033 and the base R version 3.6.2

** package 'xlsx' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry
Execution halted
ERROR: lazy loading failed for package 'xlsx'
* removing 'C:/Users/User/Documents/R/win-library/3.6/xlsx'
Warning in install.packages :
  installation of package ‘xlsx’ had non-zero exit status"```
ESCoder
  • 15,431
  • 2
  • 19
  • 42
Roma JC
  • 57
  • 5
  • Follow the steps described [here](https://stackoverflow.com/a/54213933/6123824) – UseR10085 Feb 13 '20 at 08:55
  • I'm running Windows 10, I did as Bappa Das recommended and it seemed to be working well (rJava was installed successfully) , but then when trying again to install xlsx a new error ocurred: Error: package or namespace load failed for 'xlsx': .onLoad failed in loadNamespace() for 'rJava', details: call: inDL(x, as.logical(local), as.logical(now), ...) error: unable to load shared object 'C:/Users/User/Documents/R/win-library/3.6/rJava/libs/i386/rJava.dll': LoadLibrary failure: %1 is not a valid Win32 application. – Roma JC Feb 13 '20 at 09:58
  • Every time you try to install or load `xlsx` package you have to run `Sys.setenv(JAVA_HOME="C:\\Program Files\\Java\\jdk1.8.0_201")` first. Then use `install.packages("xlsx")`, it will be installed perfectly. Please upvote the answer which I have referred to you. – UseR10085 Feb 13 '20 at 10:15

0 Answers0