GeeCON Prague 2014*
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
Author

Error: Generics are not supported in -source 1.4

bergas bimo
Greenhorn

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

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

method:
public ArrayList<Integer> initArrayList(int[] a) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i : a) {
list.add(i);
} //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é
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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
Sheriff

Joined: Oct 13, 2005
Posts: 39095
    
  23
And welcome to the Ranch
 
GeeCON Prague 2014
 
subject: Error: Generics are not supported in -source 1.4