// dependencies
compilers.add(new Java6Compiler());
compilers.add(new SunJavaC());
compilers.add(new CommandLineJavac());
for (Iterator i = compilers.iterator(); i.hasNext();) {
JavaCompiler compiler = (JavaCompiler) i.next();
if (compiler.isAvailable()) {
log.debug("Using JavaCompiler: " + compiler.getClass().getName());
return compiler;
}
}
throw new RuntimeException("No JavaCompiler implementation available on the system");
}