try {
debugLog("compiledClasses", "dest: " + dest, "src: " + src,
"classpath: " + classpath, "debug:" + debug);
del(dest);
dest.mkdirs();
JavaCompiler compiler = network.systemJavaCompiler();
if (compiler == null) {
throw new IwantException(
"Cannot find system java compiler. Are you running a JRE instead of JDK?");
}
DiagnosticListener<? super JavaFileObject> diagnosticListener = null;
Locale locale = null;
StandardJavaFileManager fileManager = compiler
.getStandardFileManager(diagnosticListener, locale,
encoding);
Iterable<? extends JavaFileObject> compilationUnits = fileManager
.getJavaFileObjectsFromFiles(src);
Writer compilerTaskOut = null;
Iterable<String> classes = null;
List<String> options = new ArrayList<String>();
options.add("-Xlint");
options.add("-Xlint:-serial");
if (debug) {
options.add("-g");
}
options.add("-d");
options.add(dest.getCanonicalPath());
options.add("-classpath");
options.add(classpath);
CompilationTask compilerTask = compiler.getTask(compilerTaskOut,
fileManager, diagnosticListener, options, classes,
compilationUnits);
Boolean compilerTaskResult = compilerTask.call();
fileManager.close();
if (!compilerTaskResult) {