0

When I try running RNetlogo on my Mac, I keep getting the following error when I try running the NLStart command.

Error in .jcall(preobj, "S", "cpsettings", .jnew("java/lang/String", nl.path), : java.awt.HeadlessException

Here is the code that I run when I get that error:

library("RNetLogo")
ver = "6.3.0" # type in Netlogo version
nl.path = "/Applications/NetLogo 6.3.0"
Sys.setenv(JAVA_HOME = file.path("Applications/jdk-11.0.17.jdk"))
NLStart(nl.path, nl.jarname = paste0("netlogo-",ver,".jar")) 

Given that the error mentions "headless", I tried modifying the NLStart command so that gui = FALSE because I don't need the graphical interface. That said it would be nice to have the graphical netlogo interface to pop up so I can experiment controlling it through R as I learn how to use RNetlogo.

But after running the modified line below, I got the same exact error as above.

NLStart(nl.path, gui = FALSE, nl.jarname = paste0("netlogo-",ver,".jar")) 
Kate
  • 1
  • 1

0 Answers0