【发布时间】:2018-06-06 21:22:13
【问题描述】:
我想从 jar 文件中运行一个名为 Hoare Advanced Homework Assistant 的程序验证工具。
首先,我从 Web 站点 ("http://haha.mimuw.edu.pl/") 下载源文件并将它们导入 Eclipse。
然后我按照 BUILD.txt 进行安排并创建了一个可执行 Jar 文件。
但是我在命令提示符下执行 jar 文件,出现以下消息。
“中止:未提供 EMF 资源的路径!”
我认为需要一个论点,但我不知道应该给出什么论点。
这是一个主类程序:
public class Main{
public static void main(String[] args) {
if (args.length==0) {
System.err.println("Aborting: no path to EMF resource provided!");
return;
}
Injector injector = new net.afyre.haha.demo.HahaStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
Main main = injector.getInstance(Main.class);
main.runGenerator(args[0]);
}
@Inject
private Provider<ResourceSet> resourceSetProvider;
@Inject
private IResourceValidator validator;
@Inject(optional=true)
private IGenerator generator;
@Inject
private JavaIoFileSystemAccess fileAccess;
protected void runGenerator(String string) {
// load the resource
ResourceSet set = resourceSetProvider.get();
Resource resource = set.getResource(URI.createURI(string), true);
// validate the resource
List<Issue> list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
if (!list.isEmpty()) {
for (Issue issue : list) {
System.err.println(issue);
}
return;
}
// configure and start the generator
fileAccess.setOutputPath("src-gen/");
if (generator != null) {
generator.doGenerate(resource, fileAccess);
} else {
System.out.println("Code generator not foubnd!");
}
System.out.println("Code generation finished.");
}
}
能否请您为我提供解决方案?谢谢。
【问题讨论】:
-
嗨,我确定 Stackoverflow 是这个问题的错误地方,请询问该软件的作者。索引页底部有联系邮箱haha.mimuw.edu.pl