Skip to content

Commit df72be4

Browse files
committed
fix namespace
1 parent 96445db commit df72be4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export(java_unpack)
1313
export(rje_consent)
1414
export(use_java)
1515
importFrom(utils,getFromNamespace)
16+
importFrom(utils,installed.packages)

R/java_env.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ java_env_set <- function(
8080
#'
8181
#' @param java_home The path to the desired JAVA_HOME.
8282
#' @keywords internal
83+
#' @importFrom utils installed.packages
8384
#'
8485
java_env_set_session <- function(java_home) {
8586

8687
# check if rJava is installed and alread initialized
87-
if (any(installed.packages()[, 1] == "rJava")) {
88+
if (any(utils::installed.packages()[, 1] == "rJava")) {
8889
if( "rJava" %in% loadedNamespaces() == TRUE ) {
8990
cli::cli_inform(c("!" = "You have `rJava` R package loaded in the current session. If you have already initialised it directly with ``rJava::.jinit()` or via your Java-dependent R package in the current session, you may not be able to switch to a different `Java` version unless you restart R. `Java` version can only be set once per session for packages that rely on `rJava`. Unless you restart the R session or run your code in a new R subprocess using `targets` or `callr`, the new `JAVA_HOME` and `PATH` will not take effect."))
9091
}

0 commit comments

Comments
 (0)