Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » AJDT and workspace JRE
AJDT and workspace JRE [message #59486] Fri, 16 December 2005 13:21 Go to next message
harry sheng is currently offline harry sheng
Messages: 37
Registered: July 2009
Member
Hi,

I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and AJDT
20051111104438.

The problem is at the runtime of the deployment generated by an ANT script
running inside Eclipse with the JRE of the workspace (not when I edit or
compile aspects).

In one of the classes, I have a statement like
BigDecimal var = new BigDecimal(123);

I get an exception for this statement at runtime,
java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V

In the ANT script, I have set the source and target compability to 1.4.

I have this problem only if I start Eclipse with JRE 1.5.0.

If I start Eclipse with JRE 1.4.2, the generated deployment works just
fine. I do not have the problem with the BigDecimal.

I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
JRE 1.5.0 ?


Harry
Re: AJDT and workspace JRE [message #59540 is a reply to message #59486] Fri, 16 December 2005 13:45 Go to previous messageGo to next message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> JRE 1.5.0 ?

Positively ancient!! There have been a LOT of bug fixes relating to Java
5 features since M2. AspectJ 5 RC1 is now out and it would be well-worth
updating.

Let me know if the problem still persists after that...

Thanks, Adrian.

harry sheng wrote:
> Hi,
>
> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and AJDT
> 20051111104438.
>
> The problem is at the runtime of the deployment generated by an ANT
> script running inside Eclipse with the JRE of the workspace (not when I
> edit or compile aspects).
>
> In one of the classes, I have a statement like
> BigDecimal var = new BigDecimal(123);
>
> I get an exception for this statement at runtime,
> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>
> In the ANT script, I have set the source and target compability to 1.4.
>
> I have this problem only if I start Eclipse with JRE 1.5.0.
>
> If I start Eclipse with JRE 1.4.2, the generated deployment works just
> fine. I do not have the problem with the BigDecimal.
>
> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> JRE 1.5.0 ?
>
>
> Harry
>
Re: AJDT and workspace JRE [message #59608 is a reply to message #59540] Fri, 16 December 2005 15:58 Go to previous messageGo to next message
harry sheng is currently offline harry sheng
Messages: 37
Registered: July 2009
Member
Hi Adrian,

I upgraded AJDT to 20051214130641 (well, I do not think the problem is
related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to use
the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.

There's no change to the problem. OK if JRE 1.4.2 is used, SAME exception
araised if JRE 1.5.0 is used.

Thanks,

Harry


Adrian Colyer wrote:

> > I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> > JRE 1.5.0 ?

> Positively ancient!! There have been a LOT of bug fixes relating to Java
> 5 features since M2. AspectJ 5 RC1 is now out and it would be well-worth
> updating.

> Let me know if the problem still persists after that...

> Thanks, Adrian.

> harry sheng wrote:
>> Hi,
>>
>> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and AJDT
>> 20051111104438.
>>
>> The problem is at the runtime of the deployment generated by an ANT
>> script running inside Eclipse with the JRE of the workspace (not when I
>> edit or compile aspects).
>>
>> In one of the classes, I have a statement like
>> BigDecimal var = new BigDecimal(123);
>>
>> I get an exception for this statement at runtime,
>> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>>
>> In the ANT script, I have set the source and target compability to 1.4.
>>
>> I have this problem only if I start Eclipse with JRE 1.5.0.
>>
>> If I start Eclipse with JRE 1.4.2, the generated deployment works just
>> fine. I do not have the problem with the BigDecimal.
>>
>> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
>> JRE 1.5.0 ?
>>
>>
>> Harry
>>
Re: AJDT and workspace JRE [message #59632 is a reply to message #59608] Sat, 17 December 2005 02:48 Go to previous messageGo to next message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
Ok, that's definitely something we need to investigate then. I need to
look at the definition of the BigDecimal class in both runtime libraries
(are you using a Sun JDK?) and do some tests. It could be an
environmental issue (different compile-time and runtime libraries), or
it could potentially be a bug. Please could you raise a bugzilla report
so that we can track it?

Thanks, Adrian.

Harry Sheng wrote:
> Hi Adrian,
>
> I upgraded AJDT to 20051214130641 (well, I do not think the problem is
> related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to
> use the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.
>
> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
> exception araised if JRE 1.5.0 is used.
>
> Thanks,
>
> Harry
>
>
> Adrian Colyer wrote:
>
>> > I use AspectJ150_M2 in the ANT script. Is this AspectJ build too
>> old for
>> > JRE 1.5.0 ?
>
>
>> Positively ancient!! There have been a LOT of bug fixes relating to
>> Java 5 features since M2. AspectJ 5 RC1 is now out and it would be
>> well-worth updating.
>
>
>> Let me know if the problem still persists after that...
>
>
>> Thanks, Adrian.
>
>
>> harry sheng wrote:
>>
>>> Hi,
>>>
>>> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and
>>> AJDT 20051111104438.
>>>
>>> The problem is at the runtime of the deployment generated by an ANT
>>> script running inside Eclipse with the JRE of the workspace (not when
>>> I edit or compile aspects).
>>>
>>> In one of the classes, I have a statement like
>>> BigDecimal var = new BigDecimal(123);
>>>
>>> I get an exception for this statement at runtime,
>>> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>>>
>>> In the ANT script, I have set the source and target compability to 1.4.
>>>
>>> I have this problem only if I start Eclipse with JRE 1.5.0.
>>>
>>> If I start Eclipse with JRE 1.4.2, the generated deployment works
>>> just fine. I do not have the problem with the BigDecimal.
>>>
>>> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old
>>> for JRE 1.5.0 ?
>>>
>>>
>>> Harry
>>>
>
Re: AJDT and workspace JRE [message #59652 is a reply to message #59632] Sat, 17 December 2005 16:08 Go to previous messageGo to next message
harry sheng is currently offline harry sheng
Messages: 41
Registered: July 2009
Member
My deployment environments are SunOne WebServer6.1 and Tomcat 5 on Win2K,
Sun JDK 1.4.2.

I used to use Sun Java compiler when I was using Eclipse 3.0. After
upgraded to Eclipse 3.1, I have to add serialVersionUID to every class I
need to serialize and transfer instances between clients and servers,
other wise I won't be able debug client code in Eclipse. So new I use
eclipse compiler to create the deployment, but the deployment environments
use Sun JDK.

Adrian Colyer wrote:

> Ok, that's definitely something we need to investigate then. I need to
> look at the definition of the BigDecimal class in both runtime libraries
> (are you using a Sun JDK?) and do some tests. It could be an
> environmental issue (different compile-time and runtime libraries), or
> it could potentially be a bug. Please could you raise a bugzilla report
> so that we can track it?

> Thanks, Adrian.

> Harry Sheng wrote:
>> Hi Adrian,
>>
>> I upgraded AJDT to 20051214130641 (well, I do not think the problem is
>> related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to
>> use the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.
>>
>> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
>> exception araised if JRE 1.5.0 is used.
>>
>> Thanks,
>>
>> Harry
Re: AJDT and workspace JRE [message #59676 is a reply to message #59652] Sun, 18 December 2005 12:45 Go to previous message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
I looked into this today... here's a copy of the comment on the bug
report for those just following on the forum:

====

The constructor BigDecimal(int) was only introduced in 1.5 (does not
exist in 1.4).

When you compile your code under Eclipse with a 1.5 JDK, it creates a
call to the BigDecimal(int) constructor (best match in the class). When
you then run it under 1.4, that method can't be found.

When you compile you code under Eclipse with a 1.4 JDK, the constructor
call is converted to BigDecimal(double) (the only matching constructor
under 1.4), which of course can be found by your 1.4 runtime.

So... if you want to run Eclipse under JDK 1.5, what you need to do is
edit the properties of your project and in the Java Build Path, make
sure you are using the 1.4 rt.jar, and not the 1.5 one. (Just setting
compiler source and target to 1.4 does *not* change the runtime library
- a trap I've fallen into myself on several occassions). Changing your
constructor call to "new BigDecimal((double)1234)" will also work, but
is nowhere near as good overall as using the right rt.jar to build!

====

Regards, Adrian.

harry sheng wrote:
> My deployment environments are SunOne WebServer6.1 and Tomcat 5 on
> Win2K, Sun JDK 1.4.2.
>
> I used to use Sun Java compiler when I was using Eclipse 3.0. After
> upgraded to Eclipse 3.1, I have to add serialVersionUID to every class I
> need to serialize and transfer instances between clients and servers,
> other wise I won't be able debug client code in Eclipse. So new I use
> eclipse compiler to create the deployment, but the deployment
> environments use Sun JDK.
>
> Adrian Colyer wrote:
>
>> Ok, that's definitely something we need to investigate then. I need to
>> look at the definition of the BigDecimal class in both runtime
>> libraries (are you using a Sun JDK?) and do some tests. It could be an
>> environmental issue (different compile-time and runtime libraries), or
>> it could potentially be a bug. Please could you raise a bugzilla
>> report so that we can track it?
>
>
>> Thanks, Adrian.
>
>
>> Harry Sheng wrote:
>>
>>> Hi Adrian,
>>>
>>> I upgraded AJDT to 20051214130641 (well, I do not think the problem
>>> is related to AJDT), downloaded AspectJ 150 RC1, updated my ANT
>>> script to use the latest AspectJ RC1, upgraded the aspectjrt.jar for
>>> my deployment.
>>>
>>> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
>>> exception araised if JRE 1.5.0 is used.
>>>
>>> Thanks,
>>>
>>> Harry
>
>
>
Re: AJDT and workspace JRE [message #591336 is a reply to message #59486] Fri, 16 December 2005 13:45 Go to previous message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> JRE 1.5.0 ?

Positively ancient!! There have been a LOT of bug fixes relating to Java
5 features since M2. AspectJ 5 RC1 is now out and it would be well-worth
updating.

Let me know if the problem still persists after that...

Thanks, Adrian.

harry sheng wrote:
> Hi,
>
> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and AJDT
> 20051111104438.
>
> The problem is at the runtime of the deployment generated by an ANT
> script running inside Eclipse with the JRE of the workspace (not when I
> edit or compile aspects).
>
> In one of the classes, I have a statement like
> BigDecimal var = new BigDecimal(123);
>
> I get an exception for this statement at runtime,
> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>
> In the ANT script, I have set the source and target compability to 1.4.
>
> I have this problem only if I start Eclipse with JRE 1.5.0.
>
> If I start Eclipse with JRE 1.4.2, the generated deployment works just
> fine. I do not have the problem with the BigDecimal.
>
> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> JRE 1.5.0 ?
>
>
> Harry
>
Re: AJDT and workspace JRE [message #591367 is a reply to message #59540] Fri, 16 December 2005 15:58 Go to previous message
harry sheng is currently offline harry sheng
Messages: 37
Registered: July 2009
Member
Hi Adrian,

I upgraded AJDT to 20051214130641 (well, I do not think the problem is
related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to use
the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.

There's no change to the problem. OK if JRE 1.4.2 is used, SAME exception
araised if JRE 1.5.0 is used.

Thanks,

Harry


Adrian Colyer wrote:

> > I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
> > JRE 1.5.0 ?

> Positively ancient!! There have been a LOT of bug fixes relating to Java
> 5 features since M2. AspectJ 5 RC1 is now out and it would be well-worth
> updating.

> Let me know if the problem still persists after that...

> Thanks, Adrian.

> harry sheng wrote:
>> Hi,
>>
>> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and AJDT
>> 20051111104438.
>>
>> The problem is at the runtime of the deployment generated by an ANT
>> script running inside Eclipse with the JRE of the workspace (not when I
>> edit or compile aspects).
>>
>> In one of the classes, I have a statement like
>> BigDecimal var = new BigDecimal(123);
>>
>> I get an exception for this statement at runtime,
>> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>>
>> In the ANT script, I have set the source and target compability to 1.4.
>>
>> I have this problem only if I start Eclipse with JRE 1.5.0.
>>
>> If I start Eclipse with JRE 1.4.2, the generated deployment works just
>> fine. I do not have the problem with the BigDecimal.
>>
>> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old for
>> JRE 1.5.0 ?
>>
>>
>> Harry
>>
Re: AJDT and workspace JRE [message #591373 is a reply to message #59608] Sat, 17 December 2005 02:48 Go to previous message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
Ok, that's definitely something we need to investigate then. I need to
look at the definition of the BigDecimal class in both runtime libraries
(are you using a Sun JDK?) and do some tests. It could be an
environmental issue (different compile-time and runtime libraries), or
it could potentially be a bug. Please could you raise a bugzilla report
so that we can track it?

Thanks, Adrian.

Harry Sheng wrote:
> Hi Adrian,
>
> I upgraded AJDT to 20051214130641 (well, I do not think the problem is
> related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to
> use the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.
>
> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
> exception araised if JRE 1.5.0 is used.
>
> Thanks,
>
> Harry
>
>
> Adrian Colyer wrote:
>
>> > I use AspectJ150_M2 in the ANT script. Is this AspectJ build too
>> old for
>> > JRE 1.5.0 ?
>
>
>> Positively ancient!! There have been a LOT of bug fixes relating to
>> Java 5 features since M2. AspectJ 5 RC1 is now out and it would be
>> well-worth updating.
>
>
>> Let me know if the problem still persists after that...
>
>
>> Thanks, Adrian.
>
>
>> harry sheng wrote:
>>
>>> Hi,
>>>
>>> I have a problem with the combination of Eclipse 3.1, JRE 1.5.0 and
>>> AJDT 20051111104438.
>>>
>>> The problem is at the runtime of the deployment generated by an ANT
>>> script running inside Eclipse with the JRE of the workspace (not when
>>> I edit or compile aspects).
>>>
>>> In one of the classes, I have a statement like
>>> BigDecimal var = new BigDecimal(123);
>>>
>>> I get an exception for this statement at runtime,
>>> java.lang.NoSuchMethodError: java.math.BigDecimal.(I)V
>>>
>>> In the ANT script, I have set the source and target compability to 1.4.
>>>
>>> I have this problem only if I start Eclipse with JRE 1.5.0.
>>>
>>> If I start Eclipse with JRE 1.4.2, the generated deployment works
>>> just fine. I do not have the problem with the BigDecimal.
>>>
>>> I use AspectJ150_M2 in the ANT script. Is this AspectJ build too old
>>> for JRE 1.5.0 ?
>>>
>>>
>>> Harry
>>>
>
Re: AJDT and workspace JRE [message #591384 is a reply to message #59632] Sat, 17 December 2005 16:08 Go to previous message
harry sheng is currently offline harry sheng
Messages: 41
Registered: July 2009
Member
My deployment environments are SunOne WebServer6.1 and Tomcat 5 on Win2K,
Sun JDK 1.4.2.

I used to use Sun Java compiler when I was using Eclipse 3.0. After
upgraded to Eclipse 3.1, I have to add serialVersionUID to every class I
need to serialize and transfer instances between clients and servers,
other wise I won't be able debug client code in Eclipse. So new I use
eclipse compiler to create the deployment, but the deployment environments
use Sun JDK.

Adrian Colyer wrote:

> Ok, that's definitely something we need to investigate then. I need to
> look at the definition of the BigDecimal class in both runtime libraries
> (are you using a Sun JDK?) and do some tests. It could be an
> environmental issue (different compile-time and runtime libraries), or
> it could potentially be a bug. Please could you raise a bugzilla report
> so that we can track it?

> Thanks, Adrian.

> Harry Sheng wrote:
>> Hi Adrian,
>>
>> I upgraded AJDT to 20051214130641 (well, I do not think the problem is
>> related to AJDT), downloaded AspectJ 150 RC1, updated my ANT script to
>> use the latest AspectJ RC1, upgraded the aspectjrt.jar for my deployment.
>>
>> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
>> exception araised if JRE 1.5.0 is used.
>>
>> Thanks,
>>
>> Harry
Re: AJDT and workspace JRE [message #591395 is a reply to message #59652] Sun, 18 December 2005 12:45 Go to previous message
Adrian Colyer is currently offline Adrian Colyer
Messages: 61
Registered: July 2009
Member
I looked into this today... here's a copy of the comment on the bug
report for those just following on the forum:

====

The constructor BigDecimal(int) was only introduced in 1.5 (does not
exist in 1.4).

When you compile your code under Eclipse with a 1.5 JDK, it creates a
call to the BigDecimal(int) constructor (best match in the class). When
you then run it under 1.4, that method can't be found.

When you compile you code under Eclipse with a 1.4 JDK, the constructor
call is converted to BigDecimal(double) (the only matching constructor
under 1.4), which of course can be found by your 1.4 runtime.

So... if you want to run Eclipse under JDK 1.5, what you need to do is
edit the properties of your project and in the Java Build Path, make
sure you are using the 1.4 rt.jar, and not the 1.5 one. (Just setting
compiler source and target to 1.4 does *not* change the runtime library
- a trap I've fallen into myself on several occassions). Changing your
constructor call to "new BigDecimal((double)1234)" will also work, but
is nowhere near as good overall as using the right rt.jar to build!

====

Regards, Adrian.

harry sheng wrote:
> My deployment environments are SunOne WebServer6.1 and Tomcat 5 on
> Win2K, Sun JDK 1.4.2.
>
> I used to use Sun Java compiler when I was using Eclipse 3.0. After
> upgraded to Eclipse 3.1, I have to add serialVersionUID to every class I
> need to serialize and transfer instances between clients and servers,
> other wise I won't be able debug client code in Eclipse. So new I use
> eclipse compiler to create the deployment, but the deployment
> environments use Sun JDK.
>
> Adrian Colyer wrote:
>
>> Ok, that's definitely something we need to investigate then. I need to
>> look at the definition of the BigDecimal class in both runtime
>> libraries (are you using a Sun JDK?) and do some tests. It could be an
>> environmental issue (different compile-time and runtime libraries), or
>> it could potentially be a bug. Please could you raise a bugzilla
>> report so that we can track it?
>
>
>> Thanks, Adrian.
>
>
>> Harry Sheng wrote:
>>
>>> Hi Adrian,
>>>
>>> I upgraded AJDT to 20051214130641 (well, I do not think the problem
>>> is related to AJDT), downloaded AspectJ 150 RC1, updated my ANT
>>> script to use the latest AspectJ RC1, upgraded the aspectjrt.jar for
>>> my deployment.
>>>
>>> There's no change to the problem. OK if JRE 1.4.2 is used, SAME
>>> exception araised if JRE 1.5.0 is used.
>>>
>>> Thanks,
>>>
>>> Harry
>
>
>
Previous Topic:Erroneous error marking in editor for introduced methods
Next Topic:Eclipse 3.2M4
Goto Forum:
  


Current Time: Fri Aug 29 12:21:14 EDT 2014

Powered by FUDForum. Page generated in 0.02172 seconds