Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aborted R Session- Fatal Error with library(xlsx) #197

Open
dlaw0077 opened this issue Apr 24, 2022 · 8 comments
Open

Aborted R Session- Fatal Error with library(xlsx) #197

dlaw0077 opened this issue Apr 24, 2022 · 8 comments

Comments

@dlaw0077
Copy link

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

@MichalLauer
Copy link

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.

@colearendt
Copy link
Owner

colearendt commented Apr 29, 2022

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!

@rucoma
Copy link

rucoma commented Apr 29, 2022

Hi, in my case fails only using RStudio.

@MichalLauer
Copy link

No worries:)
After running library(rJava) and then .jinit(), R Session is aborted and terminated.

@dlaw0077
Copy link
Author

Hello, library('rJava'); .jinit() does not work for me

@dlaw0077 dlaw0077 reopened this Apr 30, 2022
@colearendt
Copy link
Owner

colearendt commented Apr 30, 2022

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

@AndriyZhubryd
Copy link

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')

@HuaZou
Copy link

HuaZou commented Mar 27, 2024

Hi, everyone. After installing JDK 22, the bugs was fixed (When I only installed JRE, the error I met).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants