尝试在群集上无头地运行NetLogo时出现Java错误

时间:2016-03-28 16:39:23

标签: java linux cluster-computing netlogo

我试图使用linux无头地运行Netlogo,以便将作业发送到集群。我以前从未使用过linux,但我试图按照这里的指示(http://netlogo-users.18673.x6.nabble.com/Running-NetLogo-Headless-in-Behaviorspace-Sample-code-td4862232.html)。

我的脚本是:

#!/bin/bash
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -c 7
java -Xmx1024m -Dfile.encoding=UTF-8 -cp /opt/shared/netlogo/5.3.1-64/app/NetLogo.jar \
org.nlogo.headless.main \
--model /cluster/home/rfuda01/UM_model.nlogo \
--experiment UM \
--table /cluster/home/rfuda01/UM_test.csv

在输出文件中,我收到以下错误消息:

Exception in thread "main" java.lang.NoClassDefFoundError: org/nlogo/headless/main
Caused by: java.lang.ClassNotFoundException: org.nlogo.headless.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.nlogo.headless.main. Program will exit.

任何想法意味着什么或如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

“main”应该大写:“Main”。所以脚本应该是:

#!/bin/bash
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -c 7
java -Xmx1024m -Dfile.encoding=UTF-8 -cp /opt/shared/netlogo/5.3.1-64/app/NetLogo.jar \
org.nlogo.headless.Main \
--model /cluster/home/rfuda01/UM_model.nlogo \
--experiment UM \
--table /cluster/home/rfuda01/UM_test.csv