HOW TO FIX IT:
It is because eventhough you have Java 5 installed, the JVM running may be different.
Try typing this in the console window: java -version.
It will give you the Version of the Runtime Environment.
Or, if you are using an IDE, then you need to enable Java 5 support.
In Eclipse, You can add Java 5 in Window > Preferences > Java > Installed JRE’s.
and/or, Set the compiler compliance level to 5.0 (Window > Preferences > Java > Compiler)
In Netbeans, you can use (Tools -> Java Platform Manager) to check your default platform.
If you use javac commond line, try: javac -1.5 xxx.java
Reference: http://laksmono.wordpress.com/2007/05/27/syntax-error-parameterized-types-are-only-available-if-source-level-is-50/
Comments