From df72be48709d5fc71c8868d00959976888ec571b Mon Sep 17 00:00:00 2001 From: Egor Kotov Date: Fri, 13 Sep 2024 21:04:36 +0200 Subject: [PATCH 1/4] fix namespace --- NAMESPACE | 1 + R/java_env.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 6b4f6c0..67f9c4e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -13,3 +13,4 @@ export(java_unpack) export(rje_consent) export(use_java) importFrom(utils,getFromNamespace) +importFrom(utils,installed.packages) diff --git a/R/java_env.R b/R/java_env.R index 9727244..00d7e87 100644 --- a/R/java_env.R +++ b/R/java_env.R @@ -80,11 +80,12 @@ java_env_set <- function( #' #' @param java_home The path to the desired JAVA_HOME. #' @keywords internal +#' @importFrom utils installed.packages #' java_env_set_session <- function(java_home) { # check if rJava is installed and alread initialized - if (any(installed.packages()[, 1] == "rJava")) { + if (any(utils::installed.packages()[, 1] == "rJava")) { if( "rJava" %in% loadedNamespaces() == TRUE ) { 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.")) } From bb07d16d93ef5942806c737cdfcfadfd1600080e Mon Sep 17 00:00:00 2001 From: Egor Kotov Date: Fri, 13 Sep 2024 21:05:01 +0200 Subject: [PATCH 2/4] version bump and metadata update --- CITATION.cff | 13 +------------ DESCRIPTION | 2 +- NEWS.md | 6 +++++- codemeta.json | 4 ++-- inst/schemaorg.json | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 11a151c..45ef5e4 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "rJavaEnv" in publications use:' type: software license: MIT title: 'rJavaEnv: ''Java'' Environments for R Projects' -version: 0.2.1 +version: 0.2.2 doi: 10.32614/CRAN.package.rJavaEnv abstract: 'Quickly install ''Java Development Kit (JDK)'' without administrative privileges and set environment variables in current R session or project to solve common issues @@ -142,17 +142,6 @@ references: email: cderv@posit.co orcid: https://orcid.org/0000-0003-4474-2498 year: '2024' -- type: software - title: rJava - abstract: 'rJava: Low-Level R to Java Interface' - notes: Suggests - url: http://www.rforge.net/rJava/ - repository: https://CRAN.R-project.org/package=rJava - authors: - - family-names: Urbanek - given-names: Simon - email: simon.urbanek@r-project.org - year: '2024' - type: software title: testthat abstract: 'testthat: Unit Testing for R' diff --git a/DESCRIPTION b/DESCRIPTION index dbee341..6176501 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rJavaEnv Title: 'Java' Environments for R Projects -Version: 0.2.1.9000 +Version: 0.2.2 Authors@R: c( person("Egor", "Kotov", , "kotov.egor@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-6690-5345")), diff --git a/NEWS.md b/NEWS.md index 2979d2f..dd333e8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# rJavaEnv (development version) +# rJavaEnv 0.2.2 (2024-09-13) + +* Hot fix: improve robustness of setting Java environemntin the current session with either `use_java()` or `java_quick_install()`. See bug fix below. + +* Bug fix: Setting Java environment via `rJava::.jniInitialized()` rendered impossible changing Java version for `rJava`-dependent packages, because it somehow pre-initialised `rJava` # rJavaEnv 0.2.1 (2024-09-03) diff --git a/codemeta.json b/codemeta.json index 0998ab9..e0e978b 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/e-kotov/rJavaEnv", "issueTracker": "https://github.com/e-kotov/rJavaEnv/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.2.1", + "version": "0.2.2", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -164,7 +164,7 @@ }, "SystemRequirements": null }, - "fileSize": "219.168KB", + "fileSize": "219.774KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/inst/schemaorg.json b/inst/schemaorg.json index b82f28c..82ab169 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -44,7 +44,7 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.4.1 (2024-06-14)", - "version": "0.2.1" + "version": "0.2.2" }, { "id": "https://doi.org/10.32614/CRAN.package.rJavaEnv", From bae1c6dea15b2f7750ae78d87ab0012a7772081f Mon Sep 17 00:00:00 2001 From: Egor Kotov Date: Fri, 13 Sep 2024 21:06:23 +0200 Subject: [PATCH 3/4] type fix in news --- NEWS.md | 2 +- codemeta.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index dd333e8..98c467b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # rJavaEnv 0.2.2 (2024-09-13) -* Hot fix: improve robustness of setting Java environemntin the current session with either `use_java()` or `java_quick_install()`. See bug fix below. +* Hot fix: improve robustness of setting Java environment in the current session with either `use_java()` or `java_quick_install()`. See bug fix below. * Bug fix: Setting Java environment via `rJava::.jniInitialized()` rendered impossible changing Java version for `rJava`-dependent packages, because it somehow pre-initialised `rJava` diff --git a/codemeta.json b/codemeta.json index e0e978b..6797c2a 100644 --- a/codemeta.json +++ b/codemeta.json @@ -164,7 +164,7 @@ }, "SystemRequirements": null }, - "fileSize": "219.774KB", + "fileSize": "219.775KB", "citation": [ { "@type": "SoftwareSourceCode", From d789476303c045660483f5e8f9f35e39d8d455a1 Mon Sep 17 00:00:00 2001 From: Egor Kotov Date: Fri, 13 Sep 2024 21:18:47 +0200 Subject: [PATCH 4/4] submitted to cran --- CRAN-SUBMISSION | 3 +++ cran-comments.md | 23 +++-------------------- 2 files changed, 6 insertions(+), 20 deletions(-) create mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 0000000..4fbd004 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.2.2 +Date: 2024-09-13 19:17:50 UTC +SHA: bae1c6dea15b2f7750ae78d87ab0012a7772081f diff --git a/cran-comments.md b/cran-comments.md index bdfa9c1..cf5a043 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,22 +1,5 @@ -# Re-submission +# rJavaEnv 0.2.2 (2024-09-13) -## Update to 0.2.1 +* Hot fix: improve robustness of setting Java environment in the current session with either `use_java()` or `java_quick_install()`. See bug fix below. -Brings new functions based on very quick user feedback after the first release. -Also, hopefully, the new safeguarding with 'eval=false' in vignette will prevent erros on macos-oldrel https://cran.r-project.org/web/checks/check_results_rJavaEnv.html when vignette code is executed, even though the whole vignette is set no to evaluate the code. - -# rJavaEnv 0.2.1 (2024-09-03) - -* Documentation and description clean-up - -# rJavaEnv 0.2.0 (2024-08-28) - -* Improvement: `java_check_version_cmd()` and `java_check_version_rjava()` now return detected `Java` version instead of `TRUE`/`FALSE`. Note that this is a breaking change, but not critical given that the package has not obtained a significant user base yet. - -* New function `use_java()` to download, install and set `Java` from cache for the current sesssion, without touching the current project/working directory. This is intended for use with `targets` and `callr`. - -* New vignette on using the package with `targets' and 'callr` - -* Updated documentation with clearer instructions on cache folder cleanup before removing the package - -* Depends on `R` > 4.0 to be able to write to the package cache directory without extra user warning. Cache cleanup and management functions are provided, as well as the documentation in both README and vignettes. +* Bug fix: Setting Java environment via `rJava::.jniInitialized()` rendered impossible changing Java version for `rJava`-dependent packages, because it somehow pre-initialised `rJava`