I received this notice while attempting to run NetLogo simulations in R on MacOS using the nlrx package:
JAVA_HOME undefined, using java from path. For control over exact java version, set JAVA_HOME.
On Windows, I would set the JAVA version of my local as follows:
if(Sys.getenv("JAVA_HOME")==""){
Sys.setenv(JAVA_HOME = "/usr/lib/jvm/java-11-openjdk-amd64")
}
My Mac is running JRE version "1.8.0_301" and the default JDK version "15.0.1" (64-Bit Server VM). But updating the path like so did not resolve the notice:
if(Sys.getenv("JAVA_HOME")==""){
Sys.setenv(JAVA_HOME = "/usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home")
}