Here are some of the details/background. I'd strongly recommend a jakarta-commons 
shared codebase
for use by Axis, Tomcat, Cocoon and ANT (These are the ones that i know of).

- Axis's classes for Javac were borrowed from Cocoon2. It uses sun.tools.javac.Main.
- Tomcat 4.X, 3.X current uses sun.tools.javac.Main.
- Jasper2 uses ANT's Javac task.
- Ant has 2 classes 
  - Javac12.java uses sun.tools.javac.Main.
  - Javac13.java uses com.sun.tools.javac.Main. 
- Problem with both sun.tools.javac.Main and com.sun.tools.javac.Main are that they are
undocumented.
- In sun.tools.javac.Main, you can specify an output stream to capture Compile errors. 
This
"Feature" does not exist in com.sun.tools.javac.Main.
- Ant most probably redirects the System.out and System.err to get the compile errors 
when it uses
com.sun.tools.javac.Main.
- Here are the URL's:
Cocoon 2.0:
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/java/Javac.java
Tomcat 4.X:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/SunJavaCompiler.java
Tomcat 3.X:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat/src/share/org/apache/jasper/compiler/SunJavaCompiler.java
Jasper2:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
Ant:
http://cvs.apache.org/viewcvs.cgi/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
http://cvs.apache.org/viewcvs.cgi/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java

Thanks,
dims

--- "Ignacio J. Ortega" <[EMAIL PROTECTED]> wrote:
> > De: Steve Loughran [mailto:[EMAIL PROTECTED]]
> > Enviado el: 5 de junio de 2002 23:18
> 
> > Anyhows, as and when sun.tools.javac.Main goes away, you will 
> > be able to cut
> > and paste the replacement from ant.
> > 
> > Alternatively, we could factor out the java compilation 
> > adapters into a
> > jakarta-commons lib, so that other tools that compile code 
> > (Tomcat springs
> > to mind) can share code.
> 
> FYI: Jasper2 ( the proposed replacement JSP compiler for 4.1.X release )
> has switched from his own adapter to javac to the one present at the
> current Ant ( 1.4 codebase if i recall well), just for the very same
> reasons you give in your message.. it's unlikely that ant will stop to
> compile java at any future version :)).. and this way one can leave
> those things to the people that already know how.. 
> 
> Saludos ,
> Ignacio J. Ortega


=====
Davanum Srinivas - http://xml.apache.org/~dims/

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

Reply via email to