Vector (with jre1.6.0?) [message #193652] |
Tue, 13 February 2007 04:20 |
Eclipse User |
|
|
|
Originally posted by: emf.NOSPAM.email.com
I had a program that contained the line:
Vector<String> v = new Vector<String>(10);
that used to run OK. Now, however, Vector is redlined with the comment:
The type Vector is not generic; it cannot be parameterized with
arguments <String>
and <String> is relined with the comment:
Syntax Error, parameterized types are only available if source level is 5.0
What is wrong? I have upgraded to jre1.6.0. Is this version handles
differently vectors? How can I correct the problem?
-Eustace
--
JavaScript Date Calculator
http://www.geocities.com/emfrilingos/tm/datecalc.html
|
|
|
Re: Vector (with jre1.6.0?) [message #193668 is a reply to message #193652] |
Tue, 13 February 2007 07:44 |
Eclipse User |
|
|
|
Originally posted by: krzysztofHMMMMdaniel.gmail.com
Please check project properties -> Java Compiler Settings,
you should have set there Source Compatibility 5.0 or 6.0
Please let me know if it helps.
Regards,
Chris
|
|
|
|
Re: Vector (with jre1.6.0?) [message #193857 is a reply to message #193668] |
Tue, 13 February 2007 20:31 |
Eclipse User |
|
|
|
Originally posted by: emf.NOSPAM.email.com
On 2007.02.13 02:44 Krzysztof Daniel wrote:
> Please check project properties -> Java Compiler Settings,
> you should have set there Source Compatibility 5.0 or 6.0
>
>
> Please let me know if it helps.
>
> Regards,
> Chris
Thanks. It worked. But I don't understand why the default source
compatibility is not set at 6.0 in the first place. Perhaps to make
source compatible with earlier versions so, for example, an applet can
work in an older browser?
Eustace
|
|
|
Re: Vector (with jre1.6.0?) [message #193863 is a reply to message #193834] |
Tue, 13 February 2007 20:33 |
Eclipse User |
|
|
|
Originally posted by: emf.NOSPAM.email.com
On 2007.02.13 14:41 Paul Rubin wrote:
> Eustace wrote:
>> I had a program that contained the line:
>>
>> Vector<String> v = new Vector<String>(10);
>>
>> that used to run OK. Now, however, Vector is redlined with the comment:
>>
>> The type Vector is not generic; it cannot be parameterized with
>> arguments <String>
>>
>> and <String> is relined with the comment:
>>
>> Syntax Error, parameterized types are only available if source level
>> is 5.0
>>
>> What is wrong? I have upgraded to jre1.6.0. Is this version handles
>> differently vectors? How can I correct the problem?
>>
>> -Eustace
>>
>
> Changing to jre 1.6.0 should not cause a problem. Check the import
> statement to make sure you are importing java.util.Vector. There are
> Vector classes in other packages (can't recall which) that are not generic.
>
> /Paul
No, I was importing java.util.*, according to the book I am working
with. That was not the issue.
Eustace
|
|
|
|
Powered by
FUDForum. Page generated in 0.08376 seconds