Hopefully this isn’t a duplicate, I’ve searched and found some with related issues but not about the differences in Java.
private List<Stuff> apps = new ArrayList<Stuff>();
// compiles under both
private List<Stuff> apps = new ArrayList<>();
// compiles under OpenJDK 7
// SunJDK 7 Error raised is : Syntax error on token "<", ? expected after this token
Any ideas why this is the case? I like to use OpenJDK on my *nix servers and dev boxes but sometimes I use someone else’s Windows laptop for dev and testing and this is the first time I’ve had a problem between the two versions. Would appreciate any advice or thoughts!
Also I use Netbeans 7.2 (which does not flag an error on Windows or Debain). The program uses the Play Framework 1.2.5 and has the java source set to 1.7.
javac -version
javac 1.7.0_01
and
java -version
java version "1.7.0_01"
Java<TM> SE Runtime-Environment <build 1.7.0_01-b08>
and checked Netbeans everywhere I could an source is 1.7 everywhere I can tell. Compiling via the command line produced the same error described above.
ANSWER?
I updated to the latest version of SunJDK/Java (1.7.0_13) and the issue resolved for me.
I updated to the latest version of SunJDK/Java (1.7.0_13) and the issue resolved.