Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JDT/other compilers
JDT/other compilers [message #242007] Wed, 28 March 2007 14:44 Go to next message
Eclipse UserFriend
Do I understand correctly that JDT has its own compiler that gets used to
generate byte codes when I build Java files in Eclipse? If so, is there
any way to change the default build compiler in use by the IDE? I can't
seem to find anything in the preferences.


Thanks,

Cameron
Re: JDT/other compilers [message #242012 is a reply to message #242007] Wed, 28 March 2007 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Cameron,

Yes, that's true, and no, the JDT compiler is the only incremental
compiler that the IDE can use directly. You could always use Ant tasks
to invoke javac, but I wonder why you would want to do that in the IDE
itself...


Cameron Bateman wrote:
> Do I understand correctly that JDT has its own compiler that gets used
> to generate byte codes when I build Java files in Eclipse? If so, is
> there any way to change the default build compiler in use by the IDE?
> I can't seem to find anything in the preferences.
>
>
> Thanks,
>
> Cameron
>
Re: JDT/other compilers [message #242017 is a reply to message #242012] Wed, 28 March 2007 16:34 Go to previous messageGo to next message
Eclipse UserFriend
We have had an (internal) customer request that is asking whether the
compiled code that Eclipse generates for (in this case, during a WTP
runtime launch) deployment on a JavaEE server container is in some way
"certified" compared to what something like javac produces.

I suppose there is a concern that what one generates during testing using
JDT would in some significant way be "less official" to run under say a
Sun JRE than what javac will spit out at deployment.


--Cam

Ed Merks wrote:

> Cameron,

> Yes, that's true, and no, the JDT compiler is the only incremental
> compiler that the IDE can use directly. You could always use Ant tasks
> to invoke javac, but I wonder why you would want to do that in the IDE
> itself...
Re: JDT/other compilers [message #242032 is a reply to message #242017] Wed, 28 March 2007 17:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Cameron,

I see. I don't think such concerns are justified. Since I'm not a JDT
developer I can't give you concrete reassurance as to what tests are all
run to ensure conformance, but I've never heard of a problem where JDT
generated bad byte code. You could always build with Javac before you
send things to your customer..


Cameron Bateman wrote:
> We have had an (internal) customer request that is asking whether the
> compiled code that Eclipse generates for (in this case, during a WTP
> runtime launch) deployment on a JavaEE server container is in some way
> "certified" compared to what something like javac produces.
> I suppose there is a concern that what one generates during testing
> using JDT would in some significant way be "less official" to run
> under say a Sun JRE than what javac will spit out at deployment.
>
>
> --Cam
>
> Ed Merks wrote:
>
>> Cameron,
>
>> Yes, that's true, and no, the JDT compiler is the only incremental
>> compiler that the IDE can use directly. You could always use Ant
>> tasks to invoke javac, but I wonder why you would want to do that in
>> the IDE itself...
>
>
>
Re: JDT/other compilers [message #242051 is a reply to message #242032] Thu, 29 March 2007 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Ed Merks wrote:
> Cameron,
>
> I see. I don't think such concerns are justified. Since I'm not a JDT
> developer I can't give you concrete reassurance as to what tests are all
> run to ensure conformance, but I've never heard of a problem where JDT
> generated bad byte code. You could always build with Javac before you
> send things to your customer..

+1 - There is no evidence that Sun's javac is any more or less reliable
than the other compliant compilers out there. The point of having a JLS
and a JVM spec is so that alternate compiler implementations can be
developed for specific purposes. There are numerous such compilers. IMO,
someone who is trying to argue that only Sun's compiler is legitimate
only knows enough about the subject to be dangerous, not enough to speak
with authority.
In any case, I also agree with the above that it is best to have a
tool-independent build mechanism for doing production builds. Ant or
Maven is usually the tool of choice. It is not generally a good idea to
rely on an IDE to produce your production builds, especially since they
should be totally automated.

Hope this helps,
Eric
Re: JDT/other compilers [message #242055 is a reply to message #242051] Thu, 29 March 2007 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Agreed. Over the years I have encountered 2 noticeable differences
between javac and the JDT compiler. One was a bug in javac, the other
a bug in the JDT compiler. So there you go, either can have problems. :-)

Brian

Eric Rizzo wrote:
> Ed Merks wrote:
>> Cameron,
>>
>> I see. I don't think such concerns are justified. Since I'm not a
>> JDT developer I can't give you concrete reassurance as to what tests
>> are all run to ensure conformance, but I've never heard of a problem
>> where JDT generated bad byte code. You could always build with Javac
>> before you send things to your customer..
>
> +1 - There is no evidence that Sun's javac is any more or less reliable
> than the other compliant compilers out there. The point of having a JLS
> and a JVM spec is so that alternate compiler implementations can be
> developed for specific purposes. There are numerous such compilers. IMO,
> someone who is trying to argue that only Sun's compiler is legitimate
> only knows enough about the subject to be dangerous, not enough to speak
> with authority.
> In any case, I also agree with the above that it is best to have a
> tool-independent build mechanism for doing production builds. Ant or
> Maven is usually the tool of choice. It is not generally a good idea to
> rely on an IDE to produce your production builds, especially since they
> should be totally automated.
>
> Hope this helps,
> Eric
Re: JDT/other compilers -- optimization ??? [message #242129 is a reply to message #242055] Sat, 31 March 2007 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

As long as we are talking Java compilers....

javac no longer supports the -O flag that signals optimization.

What does the JDT compiler do with regard to optimization? Are
there different levels of optimization? There is no explicit
way to tell the JDT to optimize that I am aware of. Although
there is a way to tell it to not produce various debugging information
and that does help shrink the class files a bit.

So what does the JDT compiler do with regard to optimization????

Brian Vosburgh wrote:
> Agreed. Over the years I have encountered 2 noticeable differences
> between javac and the JDT compiler. One was a bug in javac, the other
> a bug in the JDT compiler. So there you go, either can have problems. :-)
>
> Brian
>
> Eric Rizzo wrote:
>
>> Ed Merks wrote:
>>
>>> Cameron,
>>>
>>> I see. I don't think such concerns are justified. Since I'm not a
>>> JDT developer I can't give you concrete reassurance as to what tests
>>> are all run to ensure conformance, but I've never heard of a problem
>>> where JDT generated bad byte code. You could always build with Javac
>>> before you send things to your customer..
>>
>>
>> +1 - There is no evidence that Sun's javac is any more or less
>> reliable than the other compliant compilers out there. The point of
>> having a JLS and a JVM spec is so that alternate compiler
>> implementations can be developed for specific purposes. There are
>> numerous such compilers. IMO, someone who is trying to argue that only
>> Sun's compiler is legitimate only knows enough about the subject to be
>> dangerous, not enough to speak with authority.
>> In any case, I also agree with the above that it is best to have a
>> tool-independent build mechanism for doing production builds. Ant or
>> Maven is usually the tool of choice. It is not generally a good idea
>> to rely on an IDE to produce your production builds, especially since
>> they should be totally automated.
>>
>> Hope this helps,
>> Eric
Re: JDT/other compilers -- optimization ??? [message #242145 is a reply to message #242129] Sun, 01 April 2007 21:13 Go to previous messageGo to next message
Eclipse UserFriend
DemonDuck a écrit :
> So what does the JDT compiler do with regard to optimization????
No optimized mode. It is always optimized :-).
--
Olivier
Re: JDT/other compilers -- optimization ??? [message #242264 is a reply to message #242145] Tue, 03 April 2007 05:44 Go to previous messageGo to next message
Eclipse UserFriend
Olivier Thomann wrote:
> DemonDuck a écrit :
>> So what does the JDT compiler do with regard to optimization????
> No optimized mode. It is always optimized :-).
> --
> Olivier
We tuned our compiler both for performance and code size optimization,
e.g. one we just fixed yesterday:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471
Re: JDT/other compilers [message #242269 is a reply to message #242055] Tue, 03 April 2007 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Brian Vosburgh wrote:
> Agreed. Over the years I have encountered 2 noticeable differences
> between javac and the JDT compiler. One was a bug in javac, the other
> a bug in the JDT compiler. So there you go, either can have problems. :-)
>
> Brian

Did they both get fixed ?
Re: JDT/other compilers [message #242289 is a reply to message #242269] Tue, 03 April 2007 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Philippe Mulet wrote:
> Brian Vosburgh wrote:
>> Agreed. Over the years I have encountered 2 noticeable differences
>> between javac and the JDT compiler. One was a bug in javac, the other
>> a bug in the JDT compiler. So there you go, either can have problems. :-)
>>
>> Brian
>
> Did they both get fixed ?

Yes.

The javac bug was related to 4030374 - problems with referencing an "outer"
class from an inner class instantiated in the "outer" class's constructor
(I think). The JDT compiler seemed to handle the situation "correctly",
while javac did not until jdk 1.4 or some such.

The JDT compiler bug was 110182 - problem re-compiling rt.jar.

Thanks.
problem resolving annotation element values [message #242294 is a reply to message #242289] Tue, 03 April 2007 11:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

If I have the annotation

@java.lang.annotation.Target(java.lang.annotation.ElementTyp e.TYPE)

and I change it so that the various parts are unqualified:

import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
...
@Target(TYPE)

I have problems resolving the enum (i.e. "TYPE").

I get annotation from the AST, then I can resolve the annotation itself by
calling IType.resolveType(String); but I cannot resolve the enum. Is there
any API I can use to resolve the enum like that available for the type?

Thanks.
Brian
Re: JDT/other compilers -- optimization ??? [message #242313 is a reply to message #242264] Tue, 03 April 2007 14:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Philippe Mulet wrote:
> Olivier Thomann wrote:
>
>> DemonDuck a écrit :
>>
>>> So what does the JDT compiler do with regard to optimization????
>>
>> No optimized mode. It is always optimized :-).
>> --
>> Olivier
>
> We tuned our compiler both for performance and code size optimization,
> e.g. one we just fixed yesterday:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471

Reassuring to know that competent programmers have their head stuck in the
byte code. That's where the real programming is...
Re: problem resolving annotation element values [message #242478 is a reply to message #242294] Thu, 05 April 2007 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Is it reasonable to add an enhancement to Bugzilla for this, or am I
missing something?

Thanks.
Brian

Brian Vosburgh wrote:
> If I have the annotation
>
> @java.lang.annotation.Target(java.lang.annotation.ElementTyp e.TYPE)
>
> and I change it so that the various parts are unqualified:
>
> import java.lang.annotation.Target;
> import static java.lang.annotation.ElementType.TYPE;
> ...
> @Target(TYPE)
>
> I have problems resolving the enum (i.e. "TYPE").
>
> I get annotation from the AST, then I can resolve the annotation itself by
> calling IType.resolveType(String); but I cannot resolve the enum. Is there
> any API I can use to resolve the enum like that available for the type?
>
> Thanks.
> Brian
Re: problem resolving annotation element values [message #242493 is a reply to message #242478] Thu, 05 April 2007 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Brian Vosburgh a écrit :
> Is it reasonable to add an enhancement to Bugzilla for this, or am I
> missing something?
Please add a bug report against JDT/Core with steps to reproduce.
--
Olivier
Re: problem resolving annotation element values [message #242498 is a reply to message #242493] Thu, 05 April 2007 13:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Olivier Thomann wrote:
> Brian Vosburgh a écrit :
>> Is it reasonable to add an enhancement to Bugzilla for this, or am I
>> missing something?
> Please add a bug report against JDT/Core with steps to reproduce.

Done: bug 181256

Thanks.
Re: JDT/other compilers [message #250824 is a reply to message #242012] Tue, 22 January 2008 20:10 Go to previous message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Reviving a thread from long ago:

While the Eclipse JDT compiler has to be used for incremental compilation by the
IDE, do you lose something if another compiler is used to generate the workspace
..class files? Performance? Hot-swap debugging? Is this even possible?

Thanks, Robert

Ed Merks wrote:
> Cameron,
>
> Yes, that's true, and no, the JDT compiler is the only incremental
> compiler that the IDE can use directly. You could always use Ant tasks
> to invoke javac, but I wonder why you would want to do that in the IDE
> itself...
>
>
> Cameron Bateman wrote:
>
>> Do I understand correctly that JDT has its own compiler that gets used
>> to generate byte codes when I build Java files in Eclipse? If so, is
>> there any way to change the default build compiler in use by the IDE?
>> I can't seem to find anything in the preferences.
>>
>>
>> Thanks,
>>
>> Cameron
>>
Previous Topic:Libraries ordering
Next Topic:How to attach sources for JUnit library?
Goto Forum:
  


Current Time: Mon Apr 28 13:11:59 EDT 2025

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

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

Back to the top