Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to extend the Java Compiler in your application
How to extend the Java Compiler in your application [message #246297] Sat, 28 July 2007 08:39 Go to next message
Eclipse UserFriend
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 #246365 is a reply to message #246297] Mon, 30 July 2007 16:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jacek.pospychala.pl.ibm.com

Moutaz,
Eclipse Java compiler is in org.eclipse.java.core plugin. From what I
see, there is one compiler class exposed in API:
org.eclipse.jdt.core.dom.CompilationUnitResolver

However I am not sure if using CompilationUnitResolver is the suggested
way to compile your own source 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.


Moutaz wrote:
> 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 #246374 is a reply to message #246365] Mon, 30 July 2007 18:09 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to extend the Java Compiler in your application [message #246379 is a reply to message #246374] Mon, 30 July 2007 18:50 Go to previous message
Eclipse UserFriend
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
Previous Topic:resolve type binding for argument list?
Next Topic:Java model event delivery question
Goto Forum:
  


Current Time: Tue Jul 22 08:40:31 EDT 2025

Powered by FUDForum. Page generated in 0.04391 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top