Error installing xlsx package

Asked

Viewed 1,772 times

3

I need to write files that are in xlsx format, a package option that does this is xlsx, but when I went to install it appeared the following error:

require(xlsx)
Carregando pacotes exigidos: xlsx
Error: package or namespace load failed for ‘xlsx’:
 .onLoad falhou em loadNamespace() para 'rJava', detalhes:
  chamada: fun(libname, pkgname)
  erro: JAVA_HOME cannot be determined from the Registry
Warning message:
package ‘xlsx’ was built under R version 3.4.4 

How do I arrange it and get the package installed?

  • 1

    Try: install.packages('rJava') and install.packages('xlsx')

  • Hello, thank you so much for your help, but it didn’t work out, the same mistake is appearing

  • 3

    Please copy your sessionInfo(). It may be incompatibility between your Java and R architecture (one in 32 bit and the other in 64 bit). My recommendation is to leave the xlsx that uses Java and go to packages readxl, to read, and writexl, to write.

4 answers

0

0

Hello,

I had a while ago the same problem as yours. My solution was to change the package. I currently use the package

Installing

install.packages("readxl")

Loading the package

library(readxl)

He is very good; even to open the sheet file you want he gets

Follow the documentation website link:

https://readxl.tidyverse.org/

0

To fix this problem go to:

1º Tools

2º Global Options

3º R version -> Change -> select "O use your machines’s default version of R (32-Bt)"

Now let’s direct the "Java JRE"

#Sys.setenv(JAVA_HOME="C: Program Files Java jre1.8.0_301") library(rJava)

Note: If you do not have Java JRE installed on your machine link below to download

https://www.oracle.com/br/java/technologies/javase-jre8-downloads.html

Now install the "xlsx Packages"

#install.Packages("xlsx")

library(xlsx)

Now only load the -> xlsx files

If it helped you just comment.

  • Please provide Additional Details in your Answer. As it’s Currently Written, it’s hard to understand your Solution.

-2

Tries install.packages("xlsx", dependencies = TRUE)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.