Java Code Examples for javax.tools.Tool#run()

The following examples show how to use javax.tools.Tool#run() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: T6350124.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 2
Source File: T6350124.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 3
Source File: T6350124.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 4
Source File: T6350124.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 5
Source File: ToolProviderTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private int runShellServiceLoader(String... args) {
    ServiceLoader<Tool> sl = ServiceLoader.load(Tool.class);
    for (Tool provider : sl) {
        if (provider.name().equals("jshell")) {
            return provider.run(cmdInStream, cmdout, cmderr, args);
        }
    }
    throw new AssertionError("Repl tool not found by ServiceLoader: " + sl);
}
 
Example 6
Source File: T6350124.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 7
Source File: T6350124.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 8
Source File: T6350124.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}
 
Example 9
Source File: T6350124.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static void compile(String... args) {
    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");
}