You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
3
3
## New features
4
4
5
+
-`Java` version (currently still only for `Amazon Corretto`) is now determined dynamically using the official GitHub `json` with releases, so when new `Java` version becomes available, you will not be depenent on `rJavaEnv` to be updated. As a fallback, versions up to 24 are hardcoded.
5
6
-`force` argument in `java_download()`. When set to `TRUE`, allows to overwrite the distribution file if it already exist in the cache.
Copy file name to clipboardExpand all lines: R/java_download.R
+31-12Lines changed: 31 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
#' Download a Java distribution
2
2
#'
3
-
#' @param version `Integer` or `character` vector of length 1 for major version of Java to download or install. If not specified, defaults to the latest LTS version. Can be "8", "11", "17", "21", "22", or 8, 11, 17, 21, or 22.
3
+
#' @param version `Integer` or `character` vector of length 1 for major version of Java to download or install. If not specified, defaults to the latest LTS version. Can be "8", "11", "17", "21", "22", "23", "24", or 8, 11, 17, 21, 22, 23, 24 or any newer version if it is available for the selected distribution.
4
4
#' @param distribution The Java distribution to download. If not specified, defaults to "Amazon Corretto". Currently only \href{https://aws.amazon.com/corretto/}{"Amazon Corretto"} is supported.
5
5
#' @param cache_path The destination directory to download the Java distribution to. Defaults to a user-specific data directory.
6
6
#' @param platform The platform for which to download the Java distribution. Defaults to the current platform.
Copy file name to clipboardExpand all lines: R/java_install.R
+52-16Lines changed: 52 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
#'
3
3
#' @description
4
4
#' Unpack Java distribution file into cache directory and link the installation into a project directory, optionally setting the `JAVA_HOME` and `PATH` environment variables to the Java version that was just installed.
5
-
#'
5
+
#'
6
6
#' @param java_distrib_path A `character` vector of length 1 containing the path to the Java distribution file.
7
7
#' @param project_path A `character` vector of length 1 containing the project directory where Java should be installed. If not specified or `NULL`, defaults to the current working directory.
8
8
#' @param autoset_java_env A `logical` indicating whether to set the `JAVA_HOME` and `PATH` environment variables to the installed Java directory. Defaults to `TRUE`.
@@ -13,7 +13,7 @@
13
13
#'
14
14
#' @examples
15
15
#' \dontrun{
16
-
#'
16
+
#'
17
17
#' # set cache dir to temporary directory
18
18
#' options(rJavaEnv.cache_path = tempdir())
19
19
#' # download, install and autoset environmnet variables for Java 17
if (!quiet) cli::cli_inform("Junction creation failed. This is likely because the project directory is not on the same disk as the R package cache directory. Java files will instead be copied to {.path {project_version_path}}")
98
+
if (!quiet)
99
+
cli::cli_inform(
100
+
"Junction creation failed. This is likely because the project directory is not on the same disk as the R package cache directory. Java files will instead be copied to {.path {project_version_path}}"
if (!quiet) cli::cli_inform("Java {version} ({filename}) for {platform} {arch} installed at {.path {installed_path}} and symlinked to {.path {project_version_path}}", .envir= environment())
150
+
if (!quiet)
151
+
cli::cli_inform(
152
+
"Java {version} ({filename}) for {platform} {arch} installed at {.path {installed_path}} and symlinked to {.path {project_version_path}}",
0 commit comments