I have been using RNetLogo with NetLogo 5.2.1 without troubles. Now I am using NetLogo 5.3 and I get this error:
> library(RNetLogo)
> nl.path <- "/Applications/NetLogo 5.3/"
> NLStart(nl.path, gui = FALSE)
java.lang.NoClassDefFoundError: org/nlogo/workspace/Controllable
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
Caused by: java.lang.ClassNotFoundException
at RJavaClassLoader.findClass(RJavaClassLoader.java:383)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.2 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RNetLogo_1.0-1 igraph_1.0.1 rJava_0.9-8
loaded via a namespace (and not attached):
[1] magrittr_1.5
Any ideas about what the problem could be?
For NetLogo version 5.3.1 the following works if you want to start NetLogo up in headless mode from R on a Mac:
First, before loading the RNetLogo library, execute
Then, execute the following:
Change your line
nl.path <- "/Applications/NetLogo 5.3/"
tonl.path <- "/Applications/NetLogo 5.3/app"
NetLogo has changed its directory structure; the netlogo jar file is now in an 'app' subdirectory.You may also need to check the environment variables that you set up as part of the RNetLogo installation.