How to extend the Java Compiler in your application [message #246297] |
Sat, 28 July 2007 08:39  |
Eclipse User |
|
|
|
Originally posted by: abaketa.yahoo.com
hii alll
i need to add the JavaCompiler into my RCP application, as i may create
some classes in a Text files and need to compile it before i save it.
So i take a compiled Code for the class (.class files).
please if u know any suggestion, give it ASAP
|
|
|
|
|
Re: How to extend the Java Compiler in your application [message #246379 is a reply to message #246374] |
Mon, 30 July 2007 18:50  |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
Olivier,
thanks for clarification.
I didn't know ecj.jar is stripped to have even less than jdt.core. I'll
have to look into it.
Olivier Thomann wrote:
> Jacek Pospychala a écrit :
>> Moutaz,
>> Eclipse Java compiler is in org.eclipse.java.core plugin. From what I
> It is rather org.eclipse.jdt.core.
>
>> see, there is one compiler class exposed in API:
>> org.eclipse.jdt.core.dom.CompilationUnitResolver
> This should not be used to simply compile Java code.
>
>> The core compiler stuff is in org.eclipse.jdt.internal.compiler.*,
>> and it's used by two tools: JavaBuilder - for compiling source code
>> in Eclipse environment and batch builder, that can be called from
>> command line. You may take a look how these tools do compiling.
> You can either use the batch compiler or use the JSR199 support.
> For the jsr199 support, you would need the plugin
> org.eclipse.jdt.compiler.tool and org.eclipse.jdt.core.
> You don't actually need the whole org.eclipse.jdt.core contents. You
> might want to add the ecj.jar on the classpath of your plugin.
>
> ecj.jar contains all the required types for the batch compiler and the
> jsr199 support.
>
> Let me know if you need more details.
> --
>
> Olivier
|
|
|
Powered by
FUDForum. Page generated in 0.04391 seconds