简体   繁体   中英

“Aborting: no path to EMF resource provided!”

I would like to run a program verification tool named Hoare Advanced Homework Assistant from jar file. First I downloaded source files from the Web site(" http://haha.mimuw.edu.pl/ ") and imported them into Eclipse. Then I arranged by following a BUILD.txt and created an Executable Jar File. But I execute the jar file at command prompt, the following message is appeared.
"Aborting: no path to EMF resource provided!"
I think an argument is needed but I don't know what argument should be given. Here is a Main class program:

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

Could you please provide me with the solution to this? Thanks.

The expected string is probably of the form "platform:/resource/my.project/my.folder/my.file" or switch "resource" with "plugin". Basically anything that fits into URI.createURI as the code indicates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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