Archive for May, 2007

Syntax error, parameterized types are only available if source level is 5.0

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.