rJavaEnv (development version)
New features
Linux support. On Linux,
libjvm.solocation is automatically detected and force-loaded viadyn.load(). Thanks to that,rJavaand any depenent R packages can be installed and loaded, if repositories with pre-built packages, such asPosit Package Manager, is used or if you buildrJavafrom source, see thejava_build_env_set()function.New function
java_build_env_set()that sets the environment (either temporarily in the current session or in./.Rprofilefile of the current working directory) to buildrJavafrom source onmacOS,LinuxandWindowsplatforms. It uses the current value ofJAVA_HOMEenvironment variable by default, so that it is more convenient to use afterjava_quick_install()oruse_java()commands. After runningjava_build_env_set(), users can installrJavafrom source withinstall.packages("rJava", type = "source")without any additional configuration. However, users will still need some system dependencies, e.g. on Linux they will need: libpcre2-dev, libdeflate-dev, libzstd-dev, liblzma-dev, libbz2-dev, zlib1g-dev, libicu-dev. A system message with a suggestedapt-getcommand is printed. On Windows,Rtoolsmust be installed. OnmacOS,Xcode Command Line Toolsmust be installed. See the new vignetteInstall 'rJava' from sourcefor more details.New function
java_get_home()to get currently setJAVA_HOME. This is just a shortcut toSys.getenv("JAVA_HOME"), as it is faster to type and can be even faster then used with autocomplete.
Improvements
Download progress printing in
java_download()respects thequietargument now (internally passing the value tocurl::curl_download()).More robust Java version detection in
java_check_version_cmd().java_quick_install()now also invisibly returns the path toJAVA_HOME.Added rlang as a dependency, as cli uses it anyway for the functions that we use in rJavaEnv, but does not declare it as a dependency. Therefore this previously might have caused annoyances to the users, as after installing rJavaEnv they could not use any of the functions until they installed rlang manually.
rJavaEnv 0.3.0
CRAN release: 2025-04-04
New features
Javaversion (currently still only forAmazon Corretto) is now determined dynamically using the official GitHubjsonwith releases, so when newJavaversion becomes available, you will not be depenent onrJavaEnvto be updated. As a fallback, versions up to 24 are hardcoded.Added
forceargument tojava_download(). When set toTRUE, allows to overwrite the distribution file if it already exist in the cache. This save the trouble of deleting the cached file withjava_clear()before re-downloading.Added a new function
java_valid_versions()allows to retrieve a list of all availableJavaversions for the current automatically detected OS and CPU architecture, or user-specified platform and architecture.
rJavaEnv 0.2.2 (2024-09-13)
CRAN release: 2024-09-13
Hot fix: improve robustness of setting
Javaenvironment in the current session with eitheruse_java()orjava_quick_install(). See bug fix below.Bug fix: Setting Java environment via
rJava::.jniInitialized()rendered impossible changing Java version forrJava-dependent packages, because it somehow pre-initialisedrJava
rJavaEnv 0.2.0 (2024-08-28)
Breaking change:
java_check_version_cmd()andjava_check_version_rjava()now return detectedJavaversion instead ofTRUE/FALSENew function
use_java()to download, install and setJavafrom cache for the current sesssion, without touching the current project/working directory. This is intended for use withtargetsandcallr.New vignette on using the package with
targets' and 'callrUpdated 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.
