Defining JAVA_HOME for nlrx package on MacOS Big Sur

89 views
Skip to first unread message

Katie Tseng

unread,
Aug 24, 2021, 3:23:45 PM8/24/21
to netlogo-users
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
")
}



Reply all
Reply to author
Forward
0 new messages