throws CompileException, IOException, ClassNotFoundException {
try {
// Create one Java source file in memory, which will be compiled later.
DrillJavaFileObject compilationUnit = new DrillJavaFileObject(className.dot, sourceCode);
CompilationTask task = compiler.getTask(null, fileManager, listener, compilerOptions, null, Collections.singleton(compilationUnit));
// Run the compiler.
if(!task.call()) {
throw new CompileException("Compilation failed", null);
} else if (!compilationUnit.isCompiled()) {
throw new ClassNotFoundException(className + ": Class file not created by compilation.");
}
// all good