I am attempting to launch batch runs for Repast Simphony on Windows without having to start the runs from within the GUI. I am able to produce the configuration properties file from within the GUI – I just want to actually start the runs from the command line, as the Repast documentation discusses.
I am experiencing a Java error as shown below when I run the command to perform batch runs. I have already confirmed that batch runs started within the batch-run GUI work successfully, so the issue appears to be something to do with how I am trying to do the runs from the command line.
Per section 9.2.1 of https://repast.github.io/docs/RepastBatchRunsGettingStarted.pdf, I saved a batch-configuration file from the batch-run GUI and placed that in the same directory as my batch_runner.jar file. I then went to run a command like java -jar batch_runner.jar -hl -r -c sample_batch_configuration.properties
command from my Bash terminal on my Windows machine. Because I have a different java version as my default java (JAVA_HOME env variable), in this case I actually am directly calling the JDK-11 that I use within Repast Simphony for the batch-run GUI, by using the following command: "C:Program FilesJavajdk-11libjava.exe" -jar batch_runner.jar -hl -r -c batch_configuration.properties
. It results in the error below, suggesting that something isn’t quite right with my Java / Groovy setup.
INFO 10:15:24,983 repast.simphony.batch.gui.HeadlessMain - Writing batch run config file to: <my_repast_directory>outputconfig.props
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at repast.simphony.batch.standalone.StandAloneMain.run(StandAloneMain.java:207)
at repast.simphony.batch.standalone.StandAloneMain.main(StandAloneMain.java:276)
Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at repast.simphony.batch.gui.HeadlessMain.createAntProject(HeadlessMain.java:87)
at repast.simphony.batch.gui.HeadlessMain.run(HeadlessMain.java:66)
at repast.simphony.batch.gui.HeadlessMain.main(HeadlessMain.java:310)
... 6 more
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 9 more
Is some additional step needed to link Java to the required Groovy capabilities when I am outside of Eclipse and trying to perform batch runs with repast simphony?