aspose file tools*
The moose likes Java in General and the fly likes Error in generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Error in generics" Watch "Error in generics" New topic
Author

Error in generics

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 358
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?


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Oct 13, 2005
Posts: 40061
    
  28
Why have you got a JRE rather than a JDK in your build path?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19794
    
  20

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).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40061
    
  28
Thank you, Rob.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19794
    
  20

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in generics