The Partial Program Analysis for Java tool can theoretically do this using the class PPAUtil:
PPAUtil.compileCU(myCompilationUnit, baseOutputFolder)
Although in practice, he expects only instances CompilationUnitthat he creates with help PPAUtil.getCU(file, options, reqName, false), so I don’t know if he will work with an instance CompilationUnitthat was not created in this way.
source
share