Package javax.tools

Examples of javax.tools.JavaCompiler.run()


            }
        }
        if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            String fileName = fileChooser.getSelectedFile().getPath();
            prefs.put("recent.file", fileName);
            javac.run(System.in, null, null, "-d", "/tmp", fileName);
        }
    }
}
View Full Code Here


import javax.tools.ToolProvider;

public class Xprint {
    public static void main(String[] args) {
        JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
        javac.run(System.in, null, null,
                  "-Xprint",
                  "com.sun.tools.javac.code.Types",
                  "com.sun.tools.javac.parser.Parser",
                  "java.util.EnumSet");
    }
View Full Code Here

        ps.close();
        fos.close();

        JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
        String javacOpts[] = {TESTFILE + ".java"};
        if (javac.run(null, null, null,  javacOpts) != 0) {
            throw new RuntimeException("compilation of " + TESTFILE + ".java Failed");
        }
    }

    static List<String> doExec(String... args) {
View Full Code Here

            }
        }
        if (fileChooser.showOpenDialog(null) == fileChooser.APPROVE_OPTION) {
            String fileName = fileChooser.getSelectedFile().getPath();
            prefs.put("recent.file", fileName);
            javac.run(System.in, null, null, "-d", "/tmp", fileName);
        }
    }
}
View Full Code Here

    final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    for (final String f1 : SizzleCompiler.find(dir)) {
      SizzleCompiler.LOG.info("compiling " + f1);
      if (f1.toString().endsWith(".java"))
        if (compiler.run(null, null, null, "-cp", classPath.toString(), f1.toString()) != 0)
          throw new RuntimeException("compile failed");
    }

    final JarOutputStream jar = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(new File(out))));
    try {
View Full Code Here

        logger.info("compiling {}", params);

        final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();

        final int r = compiler.run(null, null, null, params.toArray(new String[params.size()]));

        if (r == 0) {
            logger.info("compilation OK.");
        } else {
            logger.info("compilation failed.");
View Full Code Here

        aptArgs.add(1, "-processor");
        aptArgs.add(2, AnnotationProcessorImpl.class.getName());

        JavaCompiler javac = ToolProvider.getSystemJavaCompiler();

        return javac.run(System.in, System.out, System.err, aptArgs.toArray(new String[0]));
    }

    private void printUsage(CmdLineParser parser) {
        System.err.println("argsj-tools [options...] sourcefiles...");
        System.err.println("  Generates the list of options in XML/HTML");
View Full Code Here

            }
        }
        if (fileChooser.showOpenDialog(null) == fileChooser.APPROVE_OPTION) {
            String fileName = fileChooser.getSelectedFile().getPath();
            prefs.put("recent.file", fileName);
            javac.run(System.in, null, null, "-d", "/tmp", fileName);
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.