Skip to contents

Install Java from a distribution file

Usage

java_install(
  java_path,
  project = NULL,
  autoset_java_path = TRUE,
  verbose = TRUE
)

Arguments

java_path

The path to the Java distribution file.

project

The project directory where Java should be installed. Defaults to the current working directory.

autoset_java_path

Whether to set the JAVA_HOME and PATH environment variables to the installed Java directory. Defaults to TRUE.

verbose

Whether to print detailed messages. Defaults to TRUE.

Value

The path to the installed Java directory.

Examples

if (FALSE) {
java_install("path/to/any-java-17-aarch64-macos-jdk.tar.gz")
}