Maven needs to know where java is to run. Setting the JAVA_HOME environment variable can however cause issues with rJava. If issues do arise use clear_java_home after your dependencies are resolved.

set_java_home(java_home = find_java(), quiet = FALSE)

find_java()

clear_java_home()

is_java_available()

Arguments

java_home

Character. Indicates location of java on the system. If not provided then the function will attempt to find java using standard install paths.

quiet

Logical. If FALSE the new JAVA_HOME setting will be printed.

java availability

This function runs mvn -version to determine if java is on the system path used by maven when executed from R. This test is a little different from, for example, executing system("java -version"). There are cases where java may be available for system commands but not specifically set on a system path and hence unavailable for use by maven.