File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Error: Generics are not supported in -source 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error: Generics are not supported in -source 1.4" Watch "Error: Generics are not supported in -source 1.4" New topic

Error: Generics are not supported in -source 1.4

bergas bimo

Joined: Oct 21, 2010
Posts: 2
i was trying this code

Bill Jones wrote:
ArrayList<Integer> note = new ArrayList<Integer>();
int[] myArray = new int[]{ 58,63,67,72,70,63,62,63 };
note = initArrayList(myArray);

public ArrayList<Integer> initArrayList(int[] a) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i : a) {
} //close for loop
return list;
} //close initArrayList method

and i got this message from the debugger:
generics are not supported in -source 1.4
(use -source 5 or higher to enable generics)
public ArrayList<Integer> initArrayList(int[] a) {

what does it mean?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

This reply was originally posted by Rob Prime. Sorry for the mess...

Rob Prime wrote:That you need to change your project settings. It's now set to compile for Java 1.4.

[My Blog]
All roads lead to JavaRanch
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45359
And welcome to the Ranch
I agree. Here's the link:
subject: Error: Generics are not supported in -source 1.4
It's not a secret anymore!