Skip to content

Commit f6fa307

Browse files
authored
Merge pull request #50 from e-kotov/main
sync dev to main
2 parents fd6148f + d789476 commit f6fa307

9 files changed

+19
-38
lines changed

CITATION.cff

+1-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ message: 'To cite package "rJavaEnv" in publications use:'
88
type: software
99
license: MIT
1010
title: 'rJavaEnv: ''Java'' Environments for R Projects'
11-
version: 0.2.1
11+
version: 0.2.2
1212
doi: 10.32614/CRAN.package.rJavaEnv
1313
abstract: 'Quickly install ''Java Development Kit (JDK)'' without administrative privileges
1414
and set environment variables in current R session or project to solve common issues
@@ -142,17 +142,6 @@ references:
142142
email: cderv@posit.co
143143
orcid: https://orcid.org/0000-0003-4474-2498
144144
year: '2024'
145-
- type: software
146-
title: rJava
147-
abstract: 'rJava: Low-Level R to Java Interface'
148-
notes: Suggests
149-
url: http://www.rforge.net/rJava/
150-
repository: https://CRAN.R-project.org/package=rJava
151-
authors:
152-
- family-names: Urbanek
153-
given-names: Simon
154-
email: simon.urbanek@r-project.org
155-
year: '2024'
156145
- type: software
157146
title: testthat
158147
abstract: 'testthat: Unit Testing for R'

CRAN-SUBMISSION

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 0.2.2
2+
Date: 2024-09-13 19:17:50 UTC
3+
SHA: bae1c6dea15b2f7750ae78d87ab0012a7772081f

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rJavaEnv
22
Title: 'Java' Environments for R Projects
3-
Version: 0.2.1.9000
3+
Version: 0.2.2
44
Authors@R: c(
55
person("Egor", "Kotov", , "kotov.egor@gmail.com", role = c("aut", "cre", "cph"),
66
comment = c(ORCID = "0000-0001-6690-5345")),

NAMESPACE

+1
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)

NEWS.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# rJavaEnv (development version)
1+
# rJavaEnv 0.2.2 (2024-09-13)
2+
3+
* Hot fix: improve robustness of setting Java environment in the current session with either `use_java()` or `java_quick_install()`. See bug fix below.
4+
5+
* Bug fix: Setting Java environment via `rJava::.jniInitialized()` rendered impossible changing Java version for `rJava`-dependent packages, because it somehow pre-initialised `rJava`
26

37
# rJavaEnv 0.2.1 (2024-09-03)
48

R/java_env.R

+2-1
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
}

codemeta.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/e-kotov/rJavaEnv",
99
"issueTracker": "https://github.com/e-kotov/rJavaEnv/issues",
1010
"license": "https://spdx.org/licenses/MIT",
11-
"version": "0.2.1",
11+
"version": "0.2.2",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
@@ -164,7 +164,7 @@
164164
},
165165
"SystemRequirements": null
166166
},
167-
"fileSize": "219.168KB",
167+
"fileSize": "219.775KB",
168168
"citation": [
169169
{
170170
"@type": "SoftwareSourceCode",

cran-comments.md

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1-
# Re-submission
1+
# rJavaEnv 0.2.2 (2024-09-13)
22

3-
## Update to 0.2.1
3+
* Hot fix: improve robustness of setting Java environment in the current session with either `use_java()` or `java_quick_install()`. See bug fix below.
44

5-
Brings new functions based on very quick user feedback after the first release.
6-
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.
7-
8-
# rJavaEnv 0.2.1 (2024-09-03)
9-
10-
* Documentation and description clean-up
11-
12-
# rJavaEnv 0.2.0 (2024-08-28)
13-
14-
* 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.
15-
16-
* 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`.
17-
18-
* New vignette on using the package with `targets' and 'callr`
19-
20-
* Updated documentation with clearer instructions on cache folder cleanup before removing the package
21-
22-
* 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.
5+
* Bug fix: Setting Java environment via `rJava::.jniInitialized()` rendered impossible changing Java version for `rJava`-dependent packages, because it somehow pre-initialised `rJava`

inst/schemaorg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"url": "https://cran.r-project.org"
4545
},
4646
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
47-
"version": "0.2.1"
47+
"version": "0.2.2"
4848
},
4949
{
5050
"id": "https://doi.org/10.32614/CRAN.package.rJavaEnv",

0 commit comments

Comments
 (0)