HI All
I get the following error when i try to compile a class with the
following line:
generics are not supported in 1.4
This is the line causing the error.
LinkedList<Result> resultList = new LinkedList<Result>();
I'm using netbeans 5.5 and the jdk version is 1.5, so i dont know
where the error is coming from.
Does anyone know why.
cheers
Chris Smith - 18 Dec 2006 20:15 GMT
> I get the following error when i try to compile a class with the
> following line:
[quoted text clipped - 7 lines]
> I'm using netbeans 5.5 and the jdk version is 1.5, so i dont know
> where the error is coming from.
Check your project settings in NetBeans. The Java compiler has command
line options to specify which version of the language spec is used for
compiling code. If you have the project accidentally set to Java 1.4,
then it's quite possible that having a 1.5 JDK doesn't matter because
NetBeans is passing "-source 1.4" as a command line argument.

Signature
Chris Smith
Lew - 18 Dec 2006 20:18 GMT
> HI All
>
[quoted text clipped - 11 lines]
> Does anyone know why.
> cheers
Check the Netbeans project "properties" (right-click on the project name in
the "Projects" window and select "Properties").
Look at the "Sources" category and take a peek at the "Source _L_evel" - is it
at least "1.5"?
- Lew
Damo - 18 Dec 2006 20:26 GMT
Cheers people,
It was accidently set to 1.4.
You saved me a lot of time trying to find something daft like that!!!
Alexander Schoelling - 18 Dec 2006 20:20 GMT
Damo:
> generics are not supported in 1.4
>
[quoted text clipped - 4 lines]
> I'm using netbeans 5.5 and the jdk version is 1.5, so i dont know
> where the error is coming from.
Hi Damo,
the most probable reason is that the project is configured to compile
for Java 1.4. The setting can be changed from the project properties
dialog (Check the bottom of the source part, there is a drop-down list
labeled "Source Level" where you must select at least 1.5).
Yours,
Alexander