Package javax.tools

Examples of javax.tools.Tool


import javax.tools.ToolProvider;
import static javax.lang.model.SourceVersion.*;

public class T6395981 {
    public static void main(String... args) {
        Tool compiler = ToolProvider.getSystemJavaCompiler();
        Set<SourceVersion> expected = EnumSet.noneOf(SourceVersion.class);
        for (String arg : args)
            expected.add(SourceVersion.valueOf(arg));
        Set<SourceVersion> found = compiler.getSourceVersions();
        Set<SourceVersion> notExpected = EnumSet.copyOf(found);
        for (SourceVersion version : expected) {
            if (!found.contains(version))
                throw new AssertionError("Expected source version not found: " + version);
            else
View Full Code Here


        StringBuffer sb = new StringBuffer("compile:");
        for (String a: args)
            sb.append(' ').append(a);
        System.err.println(sb);

        Tool t = ToolProvider.getSystemJavaCompiler();
        int rc = t.run(System.in, System.out, System.err, args);
        System.out.flush();
        System.err.flush();
        if (rc != 0)
            throw new Error("compilation failed");
    }
View Full Code Here

TOP

Related Classes of javax.tools.Tool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.