Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Error related to generic type declaration
Error related to generic type declaration [message #755189] Mon, 07 November 2011 16:09 Go to next message
HainaSoft  is currently offline HainaSoft Friend
Messages: 18
Registered: October 2011
Junior Member
Hello guys,

I am trying to declare a generic type in Eclipse:

private List<String> aList;



Eclipse complaints that "the type List is not generic; it cannot be parameterized with argument <String>".

I don't understand what happened, as I double checked the Java compiler, it is JDK6 which supports generic type.

Am I missing something?
Re: Error related to generic type declaration [message #755200 is a reply to message #755189] Mon, 07 November 2011 16:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Make sure that your preferences for the project or workspace that on the
Java->Compiler preference tab that the Compiler Compliance Level is set
to at least 1.5.


--
Thanks,
Rich Kulp
Re: Error related to generic type declaration [message #755724 is a reply to message #755200] Wed, 09 November 2011 11:44 Go to previous messageGo to next message
HainaSoft  is currently offline HainaSoft Friend
Messages: 18
Registered: October 2011
Junior Member
Thanks for your reply,
I checked, it is set to 1.5. The problem still remains.
Re: Error related to generic type declaration [message #755726 is a reply to message #755724] Wed, 09 November 2011 11:50 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 09.11.2011 12:44, HainaSoft wrote:
> Thanks for your reply,
> I checked, it is set to 1.5. The problem still remains.
Check whether you really have a 1.5 JRE or higher on the project's Java
build path.

Dani
Re: Error related to generic type declaration [message #755898 is a reply to message #755726] Thu, 10 November 2011 05:50 Go to previous message
HainaSoft  is currently offline HainaSoft Friend
Messages: 18
Registered: October 2011
Junior Member
Thanks guy, I solved the problem. The project's build path contains JRE 4. I changed it to JRE 1.5
Previous Topic:Ant "Contributed Entries" not available when I run the task
Next Topic:Eclipse won't find packages
Goto Forum:
  


Current Time: Sat Apr 20 03:28:07 GMT 2024

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

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

Back to the top