Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in generics

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using java 1.5.0_15. I have a following piece of java code in eclipse



The line Iterator i = daos.iterator(); is giving error The type Iterator is not generic; it cannot be parameterized with arguments <E>.
I have checked the java build path in eclipse. It is jre 1.5.0_15.

What could be the possible reason for this problem?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check the project properties and see what the compiler compliance level is, it could still be set to to compatible with an earlier Java version
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why have you got a JRE rather than a JDK in your build path?
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Why have you got a JRE rather than a JDK in your build path?

Eclipse doesn't need a JDK. It comes with its own compiler. All it needs is a JRE, and that's only to load the classes from (rt.jar etc).
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Rob.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic