尝试在群集上无头运行NetLogo时出现Java错误
作者:互联网
我试图使用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.
任何想法这意味着什么或如何解决?
解决方法:
“ 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
标签:netlogo,java,linux,cluster-computing 来源: https://codeday.me/bug/20191012/1902130.html