我正在使用此行从bash启动一些实验:
java -Xmx50g -Dfile.encoding=UTF-8 -cp NetLogo.jar org.nlogo.headless.Main --model mymodel.nlogo --setup-file experiments/experiments.xml
我现在正试图将其包装成一个bash脚本,但它不起作用:
#!/bin/sh
MODEL="mymodel.nlogo"
SETUP="experiments/experiments.xml"
java -Xmx50g -Dfile.encoding=UTF-8 -cp NetLogo.jar org.nlogo.headless.Main --model $MODEL --setup-file $SETUP
我收到错误:
Exception in thread "main" org.xml.sax.SAXParseException; systemId: jar:file:/Users/digitaldust/NetBeansProjects/Jago2/NetLogo.jar!/system/; lineNumber: 38; columnNumber: 49; Il nome entità deve seguire immediatamente '&' nel riferimento di entità.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:885)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1547)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1319)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:348)
at org.nlogo.lab.ProtocolLoader$Loader.load(ProtocolLoader.scala:61)
at org.nlogo.lab.ProtocolLoader.loadOne(ProtocolLoader.scala:17)
at org.nlogo.lab.Lab.newWorker(Lab.scala:27)
at org.nlogo.lab.Lab.run(Lab.scala:42)
at org.nlogo.headless.Main$.runExperiment(Main.scala:24)
at org.nlogo.headless.Main$$anonfun$main$1.apply(Main.scala:14)
at org.nlogo.headless.Main$$anonfun$main$1.apply(Main.scala:14)
at scala.Option.foreach(Option.scala:197)
at org.nlogo.headless.Main$.main(Main.scala:14)
at org.nlogo.headless.Main.main(Main.scala)