Package: rJavaEnv 0.3.0.9000

rJavaEnv: 'Java' Environments for R Projects

Quickly install 'Java Development Kit (JDK)' without administrative privileges and set environment variables in current R session or project to solve common issues with 'Java' environment management in 'R'. Recommended to users of 'Java'/'rJava'-dependent 'R' packages such as 'r5r', 'opentripplanner', 'xlsx', 'openNLP', 'rWeka', 'RJDBC', 'tabulapdf', and many more. 'rJavaEnv' prevents common problems like 'Java' not found, 'Java' version conflicts, missing 'Java' installations, and the inability to install 'Java' due to lack of administrative privileges. 'rJavaEnv' automates the download, installation, and setup of the 'Java' on a per-project basis by setting the relevant 'JAVA_HOME' in the current 'R' session or the current working directory (via '.Rprofile', with the user's consent). Similar to what 'renv' does for 'R' packages, 'rJavaEnv' allows different 'Java' versions to be used across different projects, but can also be configured to allow multiple versions within the same project (e.g. with the help of 'targets' package). For users who need to install 'rJava' or other 'Java'-dependent packages from source, 'rJavaEnv' will display a message with instructions on how to run 'R CMD javareconf' to make the 'Java' configuration permanent, but also provides a function 'java_build_env_set' that sets the environment variables in the current R session temporarily to allow installation of 'rJava' from source without 'R CMD javareconf'. On 'Linux', in addition to setting environment variables, 'rJavaEnv' also dynamically loads 'libjvm.so' to ensure 'rJava' works correctly. See documentation for more details.

Authors:Egor Kotov [aut, cre, cph], Chung-hong Chan [aut], Mauricio Vargas [ctb], Hadley Wickham [ctb], Enrique Mondragon-Estrada [ctb], Jonas Lieth [ctb]

rJavaEnv_0.3.0.9000.tar.gz
rJavaEnv_0.3.0.9000.zip(r-4.7)rJavaEnv_0.3.0.9000.zip(r-4.6)rJavaEnv_0.3.0.9000.zip(r-4.5)
rJavaEnv_0.3.0.9000.tgz(r-4.6-any)rJavaEnv_0.3.0.9000.tgz(r-4.5-any)
rJavaEnv_0.3.0.9000.tar.gz(r-4.7-any)rJavaEnv_0.3.0.9000.tar.gz(r-4.6-any)
rJavaEnv_0.3.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
rJavaEnv/json (API)
NEWS

# Install 'rJavaEnv' in R:
install.packages('rJavaEnv', repos = c('https://e-kotov.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/e-kotov/rjavaenv/issues

Pkgdown/docs site:https://www.ekotov.pro

On CRAN:

Conda:

environmentsjavareproducibilityreproducible-researchquarto

8.03 score 24 stars 30 scripts 852 downloads 30 exports 13 dependencies

Last updated from:ae11c95f09. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK140
source / vignettesOK200
linux-release-x86_64OK145
macos-release-arm64OK148
macos-oldrel-arm64OK132
windows-develOK140
windows-releaseOK118
windows-oldrelOK125
wasm-releaseOK125

Exports:java_build_env_setjava_build_env_unsetjava_check_compatibilityjava_check_version_cmdjava_check_version_rjavajava_clearjava_clear_distribjava_clear_installedjava_clear_projectjava_downloadjava_ensurejava_env_setjava_env_unsetjava_find_systemjava_get_homejava_installjava_listjava_list_availablejava_list_distribjava_list_installedjava_list_projectjava_quick_installjava_resolvejava_unpackjava_valid_versionslocal_java_envrje_consentuse_javawith_java_envwith_rjava_env

Dependencies:backportscachemcheckmateclicurldigestfastmapmemoiseRcppRcppSimdJsonrlangwithryaml

Install rJava from source

Rendered frominstall-rjava-from-source.qmdusingquarto::htmlon Jun 13 2026.

Last update: 2025-12-30
Started: 2025-09-07

Multiple Java environments in one project with targets and callr

Rendered frommultiple-java-with-targets-callr.qmdusingquarto::htmlon Jun 13 2026.

Last update: 2025-09-07
Started: 2024-08-28

Quick Start Guide: Java Setup for 'R' Projects

Rendered fromrJavaEnv.qmdusingquarto::htmlon Jun 13 2026.

Last update: 2026-01-13
Started: 2024-08-20

Step-by-step: Download, Install, and Setup Java for 'R' Projects

Rendered fromrJavaEnv-step-by-step.qmdusingquarto::htmlon Jun 13 2026.

Last update: 2026-01-13
Started: 2024-08-20

Using rJavaEnv in R Packages

Rendered fromfor-developers.qmdusingquarto::htmlon Jun 13 2026.

Last update: 2025-12-30
Started: 2025-12-30

Readme and manuals

Help Manual

Help pageTopics
Set up the environment for building R packages with Java dependencies from sourcejava_build_env_set
Unset the Java build environment variables in the project .Rprofilejava_build_env_unset
Verify rJava Compatibility (Guard)java_check_compatibility
Check installed Java version using terminal commandsjava_check_version_cmd
Check Java Version with a Specified JAVA_HOME Using a Separate R Sessionjava_check_version_rjava
Manage Java installations and distributions cachesjava_clear
Clear the Java distributions cache folderjava_clear_distrib
Clear the Java installations cache folderjava_clear_installed
Clear the Java versions symlinked in the current projectjava_clear_project
Download a Java distributionjava_download
Ensure specific Java version is setjava_ensure
Set the 'JAVA_HOME' and 'PATH' environment variables to a given pathjava_env_set
Unset the JAVA_HOME and PATH environment variables in the project .Rprofilejava_env_unset
Discover system-wide Java installationsjava_find_system
Get JAVA_HOMEjava_get_home
Install Java from a distribution filejava_install
List the contents of the Java versions installed or cachedjava_list
List Available Java Versionsjava_list_available
List the contents of the Java distributions cache folderjava_list_distrib
List the contents of the Java installations cache folderjava_list_installed
List the Java versions symlinked in the current projectjava_list_project
Download and install and set Java in current working/project directoryjava_quick_install
Resolve path to specific Java versionjava_resolve
Unpack a Java distribution file into cache directoryjava_unpack
Retrieve Valid Java Versionsjava_valid_versions
Set Java environment for the current scopelocal_java_env
Obtain User Consent for rJavaEnvrje_consent
Install specified Java version and set the 'JAVA_HOME' and 'PATH' environment variables in current R sessionuse_java
Execute code with a specific Java environmentwith_java_env
Execute rJava code in a separate process with specific Java versionwith_rjava_env