I am trying to compile java code dynamically using javaCompiler. Code works gr8 however I need to get the list of class files created by CompilationTask. Here is source code
The javax.tools.JavaCompiler#getTask() method takes an options parameter that allows to set compiler options. Set the destination directory for class files using -d
option
List options = new ArrayList();
// Sets the destination directory for class files
options.addAll(Arrays.asList("-d","/home/myclasses"));
CompilationTask task = compiler.getTask (null,fileManager, diagnostics, options, null, compilationUnits);
Now get all the files with .class
extentions