xlsx
xlsx copied to clipboard
Aborted R Session- Fatal Error with library(xlsx)
Hello, can anyone help me fix the issue stated above? I am taking a R Bootcamp and am trying to write to an excel, but whenever I do library(xlsx) the whole session is aborted.
I have gone through the whole process of uninstalling and reinstalling Java and I don't know what else to do. If this helps:
sessionInfo() R version 4.2.0 (2022-04-22 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages: [1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached): [1] compiler_4.2.0 tools_4.2.0
Hi, having the same issue and it looks like the package is not compatible with R 4.2. When I run the same script on R version 4.1.3, everything works as expected.
Interesting! And apologies for the trouble! Does library('rJava'); .jinit()
work for you? Crashes at startup are always important to check whether it is xlsx
or the Java runtime itself that is causing the problem. I haven't added R 4.2 to CI yet (it is still quite new), but plan to do that!
Hi, in my case fails only using RStudio.
No worries:)
After running library(rJava)
and then .jinit()
, R Session is aborted and terminated.
Hello, library('rJava'); .jinit() does not work for me
Yes, if .jinit()
fails, that suggests that the problem is with rJava
or your java installation, not necessarily with xlsx
. It's also possible that your Java installation conflicts somehow with RStudio running / environment variables that RStudio sets. (I would check the differences in the output of Sys.getenv()
between a working / not working environment in the latter case)
Anyhow, xlsx
unfortunately requires a functional rJava
installation to work. If .jinit()
is not working, you are better off asking for help in the rJava
community and debugging your Java installation (there are several good debugging steps here). If you want to dispense with the Java dependency, then there are packages like openxlsx
that do not have the Java dependency
For me installing rJava
from source removed this issue on 4.2.0 (.jinit()
started working and xlsx
loading without crash):
install.packages("rJava", repos="https://rforge.net", type='source')
Hi, everyone. After installing JDK 22, the bugs was fixed (When I only installed JRE, the error I met).