I have checked this line with my OpenJDK javac
:
List l = new ArrayList<String>();
It compiles with no complaints at all.
Based on your second error ("List
takes no type arguments"), my guess is that you have either a List
type defined in the same package and it is taking precedence over the JDK type, or you are using more import statements which you did not show, such as
import java.awt.*;
where that package contains a List
widget.