JavaCompiler : Java Glossary
home J words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2006-02-18 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
JavaCompiler
javax.tools.JavaCompiler is a JDK 1.6+ interface that lets your program fire up the Java compiler, (usually javac.exe) and compile Java source, all under your program’s control, in a platform-independent way.

You don’t use exec or sun.tools.javac. Main any more.

Benefits Learning More
Sample Code Links
sun.tools.javac.Main

Benefits

The advantages of the JavaCompiler approach are:

Sample Code

I still have not figured out how JavaCompiler works. Its extreme generality and total lack of documenation makes it unusually inscrutable. Here is how far I have got. I still can’t figure out how to control where the compiler puts the *.class files.

sun.tools.javac.Main

In JDK 1.5- you have the deprecated, undocumented sun.tools.javac.Main to fire up the Javac.exe compiler to run in the same JVM and compile under your control.

Learning More

Sun’s Javadoc on the JavaCompiler class : available:
Sun’s Javadoc on the JavaFileObject class : available:
Sun’s Javadoc on the ForwardingJavaFileObject class : available:
Sun’s Javadoc on the SimpleJavaFileObject class : available:
Sun’s Javadoc on the JavaFileManager class : available:
Sun’s Javadoc on the ToolProvider class : available:

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.18] Spread the Net
You are visitor number 1,069.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/javacompiler.html J:\mindprod\jgloss\javacompiler.html