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

fix java_env_set_session #49

Merged
merged 5 commits into from
Sep 13, 2024
Merged

fix java_env_set_session #49

merged 5 commits into from
Sep 13, 2024

Conversation

e-kotov
Copy link
Owner

@e-kotov e-kotov commented Sep 13, 2024

Apparently, using:

rJava::.jniInitialized()

kind of misses the point, as it almost initialises rJava. That is, after this check, no matter what we do with environment variables, rJava::.jinit() will NOT pick up the Java from JAVA_HOME or any other related environment variables.

So we resort to just checking if the user has {rJava} installed AND loaded in the namespace and give warning. Loading the packages that rely on {rJava} does not usually attach {rJava}. So if the user has already tried some functions from the {rJava}-dependent package that initialised {rJava} or did it directly with rJava::.jinit(), they will have {rJava} attached. If they did not do any of that, {rJava} is unlikely to be attached and we can hide the warning about impossibility to change the Java version in the current session.

@e-kotov e-kotov merged commit 96445db into main Sep 13, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant