我想弄清楚如何运行一个需要传递不同类型参数的java程序。 这里是作者程序的说明:
RUN:
$ cd wmart/work/
$ java -jar WMartSimulator <seed> <maxDays> <daysForward> <membersFile> [<parameters>]
根据您的环境,Java可能需要足够的选项。例如:
$ java -d64 -Xms1G -Xmx30G -Djava.library.path=/usr/ilog/cplex/bin/x86-64_debian4.0_4.1:/usr/local/lib -jar WMartSimulator.jar 0 30 7 member/type1.csv demandfile=demand/trial.csv\;demand/trial.csv:logdir=result/trial-type1
我试图通过将他的具体指示映射到我的所有者来执行该程序。这就是我所做的:
在eclipse的程序参数中,我说:
0 30 7 bin/work/member/type1.csv "demandfile=bin/work/demand/trial.csv"
虚拟机参数:
-Djava.library.path =“C:\ Program Files(x86)\ LPSolve IDE \ LpSolveIDE.exe”
设置完成后,我得到了以下错误的一般描述:
java.lang.NullPointerException
at edu.iw.mace.environment.Settings.<init>(Settings.java:69)
at edu.iw.mace.environment.Market.<init>(Market.java:94)
at edu.iw.mace.environment.Market.<init>(Market.java:79)
at org.wmart.core.WBoard.<init>(WBoard.java:67)
at org.wmart.core.WAuctioneer.initialize(WAuctioneer.java:52)
at org.wmart.core.WMart.setupAuctioneers(WMart.java:1339)
at org.wmart.core.WMart.<init>(WMart.java:112)
at org.wmart.core.WMartSimulator.<init>(WMartSimulator.java:83)
at org.wmart.core.WMartSimulator.main(WMartSimulator.java:47)
Settings.java:69的相应bloc代码是:
public Settings() throws FactoryException, MaceException {
try {
config = new PropertiesConfiguration(PROPERTIES_FILE);
} catch (ConfigurationException e) {
log.error(e.fillInStackTrace());
}
config.setAutoSave(true);// line 69
initProperties();
}
我想知道我是否正确地遵循了作者网站上的规定: https://github.com/ikfj/wmart/#run
你能告诉我配置中的错误吗?而且,如果你能给我一些处理这些特定问题的具体文件。