views:

112

answers:

1

Hi everyone,

I'm using Java in Eclipse on Mac OS X 10.5 (JDK Compliance level 5.0) with and I'm getting very strange compilation problems that I wasn't getting before (and I don't think I've updated my compiler or Eclipse, but maybe an update was installed that I wasn't aware of). For example if I have the following line in my code:

List foo = new LinkedList();

I get a warning that says:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
Type mismatch: cannot convert from LinkedList to List

Anyone know what's wrong?

Thanks

+9  A: 

I would check which List has been imported by Eclipse for you. If it is a GUI java.awt.List, it is not the java.util.List interface that LinkedList implements and would therefore cause that compile-time error.

akf
thanks, that was it. argh!
Justin