Skip to contents

Set the JAVA_HOME and PATH environment variables to a given path

Usage

java_env_set(
  java_home,
  where = c("both", "session", "project"),
  verbose = TRUE
)

Arguments

java_home

The path to the desired JAVA_HOME.

where

Where to set the JAVA_HOME: "session", "project", or "both". Defaults to "both". When "both" or "project" is selected, the function updates the .Rprofile file in the project directory to set the JAVA_HOME and PATH environment variables at the start of the R session.

verbose

Whether to print detailed messages. Defaults to TRUE.

Value

Nothing. Sets the JAVA_HOME and PATH environment variables.

Examples

if (FALSE) { # \dontrun{
java_env_set("/path/to/java", "both")
} # }