Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » The type List is not generic; it cannot be parameterized with arguments <String>
The type List is not generic; it cannot be parameterized with arguments <String> [message #169800] Wed, 06 September 2006 15:29 Go to next message
Eclipse UserFriend
Originally posted by: lonewolf32us.yahoo.com

Can anyone explain the following error in Eclipse 3.2? I am running Java SDK
1.6 and Eclipse's compliance settings are set to "6.0"

Offending code:
List<String> phases = new ArrayList<String>();

Error message:
The type List is not generic; it cannot be parameterized with arguments
<String>

If I change List to ArrayList, it compiles, however I should not need to do
this.

Thanks,
Dave
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #169808 is a reply to message #169800] Wed, 06 September 2006 15:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lonewolf32us.yahoo.com

Another person with the same problem
http://onthethought.blogspot.com/2005/01/so-much-for-eclipse -31-compliance.html
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #169847 is a reply to message #169800] Wed, 06 September 2006 20:33 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Dave a écrit :
> Can anyone explain the following error in Eclipse 3.2? I am running Java SDK
> 1.6 and Eclipse's compliance settings are set to "6.0"
>
> Offending code:
> List<String> phases = new ArrayList<String>();
>
> Error message:
> The type List is not generic; it cannot be parameterized with arguments
> <String>
>
> If I change List to ArrayList, it compiles, however I should not need to do
> this.
Could you please open a bug report against JDT/Core with steps to reproduce?
Please provide build id, JRE on the project classpath, compiler settings.
I tried quickly and I could not reproduce.

Thanks,
--
Olivier
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #169886 is a reply to message #169800] Thu, 07 September 2006 06:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.illgner.email.de

Dave wrote:
> Can anyone explain the following error in Eclipse 3.2? I am running Java SDK
> 1.6 and Eclipse's compliance settings are set to "6.0"
>
> Offending code:
> List<String> phases = new ArrayList<String>();
>
> Error message:
> The type List is not generic; it cannot be parameterized with arguments
> <String>
>
> If I change List to ArrayList, it compiles, however I should not need to do
> this.
>
Dumb Question ...
are you sure that List is from package java.util and not from
javax.swing ? Eclipse often chooses the swing version during auto
complete ....
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #170161 is a reply to message #169886] Fri, 08 September 2006 22:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Michael Illgner" <michael.illgner@email.de> wrote in message
news:edof78$utd$1@utils.eclipse.org...
> Dumb Question ...
> are you sure that List is from package java.util and not from javax.swing
> ? Eclipse often chooses the swing version during auto complete ....

Also, make sure that you have a 1.5 JRE on your classpath, rather than a 1.4
JRE.
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #170169 is a reply to message #170161] Fri, 08 September 2006 22:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Walter Harley" <wharley@bea.com> wrote in message
news:edss7f$i7c$1@utils.eclipse.org...
> "Michael Illgner" <michael.illgner@email.de> wrote in message
> news:edof78$utd$1@utils.eclipse.org...
>> Dumb Question ...
>> are you sure that List is from package java.util and not from javax.swing
>> ? Eclipse often chooses the swing version during auto complete ....
>
> Also, make sure that you have a 1.5 JRE on your classpath, rather than a
> 1.4 JRE.


Sorry, clearly I mean "a 1.6 JRE... rather than a 1.4 JRE."
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #170332 is a reply to message #169886] Mon, 11 September 2006 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lonewolf32us.yahoo.com

Apparently this is not a dumb question, because its exactly what I did.
java.awt.List was imported instead of java.util.List.

Thanks!

Michael Illgner <michael.illgner@email.de> wrote:
Dumb Question ...aare you sure that List is from package java.util and not
from bjavax.swing ? Eclipse often chooses the swing version during auto
scomplete ....
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #1683617 is a reply to message #170169] Wed, 18 March 2015 05:20 Go to previous messageGo to next message
Suman Dey is currently offline Suman DeyFriend
Messages: 1
Registered: March 2015
Junior Member
I am facing the same problem. I have imported java.util but still not able to create the generic type List. Please help.
Re: The type List is not generic; it cannot be parameterized with arguments <String> [message #1685080 is a reply to message #1683617] Wed, 18 March 2015 18:00 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4003
Registered: July 2009
Senior Member

Unable to create it when you do what?

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:SWT - AWT integration on macosx platform - 10.10.2.
Next Topic:Source Folder for Servlet
Goto Forum:
  


Current Time: Sun Mar 07 21:45:30 GMT 2021

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

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

Back to the top