Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Vector (with jre1.6.0?)
Vector (with jre1.6.0?) [message #193652] Tue, 13 February 2007 04:20 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #193834 is a reply to message #193652] Tue, 13 February 2007 19:41 Go to previous messageGo to next message
Paul A. Rubin is currently offline Paul A. RubinFriend
Messages: 188
Registered: July 2009
Senior Member
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
Re: Vector (with jre1.6.0?) [message #193857 is a reply to message #193668] Tue, 13 February 2007 20:31 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Vector (with jre1.6.0?) [message #652572 is a reply to message #193668] Fri, 04 February 2011 15:21 Go to previous message
Sanjay Kushwah is currently offline Sanjay KushwahFriend
Messages: 1
Registered: February 2011
Junior Member
Heyy!! thanx....man u saved my time...Smile
i was stuck with this for a while....
bt ur post helped me.....again thanx!!!
Previous Topic:Add javadoc for other packages?
Next Topic:Naming the bundles for my project
Goto Forum:
  


Current Time: Thu Apr 25 15:18:29 GMT 2024

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

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

Back to the top