IDEA with JDK 1.7?

Has anyone successfully built applications targeting JDK 1.7 with IntelliJ 6.0.4?

I tried over the weekend to do so using a for each loop and variable argument lists but it didn't work. When I changed back to JDK 1.6 it worked fine.

6 comments
Comment actions Permalink

yes i did. i think i did. i've been using 1.7 for ages with a lot of eap and final builds

0
Comment actions Permalink

I guess you're both mistaking 1.7 for 1.6 ? or is a 1.7 out already ?

0
Comment actions Permalink

well thanks !

0
Comment actions Permalink

no, but i'm an eap freak. was using java7 eap, idea eap and yourkit profiler eap at the same time :D

0
Comment actions Permalink

Here is the code that I tried.

public class TryLimitedVariableArgumentList {
public static double average(double ... values) {
double sum;

if (values.length == 0) {
return 0.0;
}

sum = 0.0;
for (double value : values) {
sum += value;
}
return sum / values.length;
}

public static void main(String[] args) {
System.out.println("Average of 3.14, 2.1 and 6.16 " +
average(3.14, 2.1, 6.16));
System.out.println("Average of 1.5, 9.02, 3.03 and 2.16 " +
average(1.5, 9.02, 3.03, 2.16));
}
}

When I use the JDK 1.6 it compiles just fine, but with the 1.7 I get the following errors:

Error (9,41) variable-anty methods are not supported in -source 1.3 (use -source 5 or higher to enable variable-anty methods)
Error (17,27) for-each loops are not supported n -source 1.3 (ise -source 5 or higher to enable for-each loops)

In the Project JDK: I have 1.7 (java version "1.7.0-ea") and in Project language level I have 5.0 - 'enum' keyword, autoboxing, etc.

0

Please sign in to leave a comment.