Cover Page by Gary Cornell, Cay S. Horstmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

10.2.2. Using Compilation Tasks

You can have even more control over the compilation process with a CompilationTask object. In particular, you can

• Control the source of program code—for example, by providing code in a string builder instead of a file.

• Control the placement of class files—for example, by storing them in a database.

• Listen to error and warning messages as they occur during compilation.

• Run the compiler in the background.

The location of source and class files is controlled by a JavaFileManager. It is responsible for determining JavaFileObject instances for source and class files. A JavaFileObject can correspond to a disk file, or it can provide another mechanism for reading and writing its contents.

To listen to error messages, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required