Phil, others, There is even a more official "batch" interface to the eclipse compiler in the org.eclipse.jdt.core plugin which is much like the original Java compiler:
package org.eclipse.jdt.internal.compiler.batch; public class Main implements ProblemSeverities { public Main(PrintWriter outWriter, PrintWriter errWriter, boolean systemExitWhenFinished) { ... } /* * Low-level API performing the actual compilation */ public boolean compile(String[] argv) { } /* * External API */ public static void main(String[] argv) { } } I experimented with it and it seems like this is not dependent on any other part of eclipse (jdtcore.jar is sufficient) and is working in 90% of the cases just as javac. But I also got a few additional warnings (import not used, etc - you know these from the eclipse task bar) and errors which I do not yet know exactly where they come from (Lacking -sourcepath? Other -target ?). So maybe this is just an issue in our environment. CGJ -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 2. April 2003 03:21 An: [EMAIL PROTECTED] Betreff: [JBoss-dev] JDT compiler was: php5 is coming JDT stands for Java Development Tools and is a subproject of the Eclipse framework. I looked through the source a bit and it looks like the main compiler class is org.eclipse.jdt.internal.compiler.Compiler. I found the source in my plugins directory of Eclipse (no additional download needed) under the directory org.eclipse.jdt.source_2.1.0/src in the jdtcoresrc.zip. The only problem is that this is an "internal" package which means that there is neither binary nor api contracts between releases. The Eclipse project committers seems to tend to try to open the API's to everyone once they stabilize, so if someone puts a little pressure on them, they might be willing to move this class out of the internal package. There is a method in the Compiler class with the signature: public void compile(ICompilationUnit[] sourceUnits) This looks like the method that would be most useful. The ICompilationUnit interface isn't the most basic interface in the world. There are quite a few methods, but a look through the compiler code may give clues to which methods are necessary. This interface doesn't really care where your java code came from so it would definately meet the criteria for an in memory compiler. The other obstacle is the constructor to the Compiler class. It requires quite a few interfaces to be fleshed out. The signature is: public Compiler(INameEnvironment environment, IErrorHandlingPolicy policy, Map settings, final ICompilerRequestor requestor, IProblemFactory problemFactory) It really doesn't look like this was meant to be used outside of the larger JDT framework, but might be worth the trouble if other alternatives don't look so good. -Phil "Scott M Stark" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent by: cc: [EMAIL PROTECTED] Subject: Re: Re[2]: [JBoss-dev] php5 is coming ceforge.net 04/01/03 02:04 PM Please respond to jboss-development I don't know what JDT is. It was not I who suggested it. The JDT page says: http://www.eclipse.org/jdt/index.html The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins. It adds a Java project nature and Java perspective to the Eclipse Workbench as well as a number of views, editors, wizards, builders, and code merging and refactoring tools. The JDT project allows Eclipse to be a development environment for itself. Not obviously an in memory compiler, but maybe in there somewhere. xxxxxxxxxxxxxxxxxxxxxxxx Scott Stark Chief Technology Officer JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ----- Original Message ----- From: "julien viet" <[EMAIL PROTECTED]> To: "Scott M Stark" <[EMAIL PROTECTED]> Sent: Tuesday, April 01, 2003 11:45 AM Subject: Re[2]: [JBoss-dev] php5 is coming > what is supposed to be eclipse JDT ? > > SMS> So get another compiler. We don't need no stinking JSR. > ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development