繁体   English   中英

“正在中止:没有提供EMF资源的途径!”

[英]“Aborting: no path to EMF resource provided!”

我想从jar文件中运行一个名为Hoare Advanced Homework Assistant的程序验证工具。 首先,我从网站(“ http://haha.mimuw.edu.pl/ ”)下载源文件,并将它们导入Eclipse。 然后,我按照BUILD.txt进行排列,并创建了一个可执行的Jar文件。 但是我在命令提示符下执行jar文件,出现以下消息。
“正在中止:未提供EMF资源的路径!”
我认为需要一个论点,但我不知道应该给出什么论点。 这是一个Main class程序:

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.");
    }
}

您能为我提供解决方案吗? 谢谢。

预期的字符串的格式可能为“ platform:/resource/my.project/my.folder/my.file”,或使用“ plugin”切换“ resource”。 基本上,如代码所示,任何适合URI.createURI的内容。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM