Error in Netbeans using Java: "error: diamond operator is not supported in -source 1.5"

2

I'm trying to use a List of List s in Java in NetBeans for the first time:

List<List<String>> listao = new ArrayList<>();

But it has a compile error on the line where I have the list:

  

error: diamond operator is not supported in -source 1.5

And it presents the tip:

  

use -source 7 or higher to enable diamond operator

Okay, but what source is this, and how to do that?

    
asked by anonymous 23.07.2018 / 02:58

1 answer

3

Firstly, right click on your project to see the drop down menu of the figure below, where you see the "Properties" or "Properties" item:

Whenyouopentheproperties,changetheboxfromthesourcecodeformattoJDK7orgreater:

    
23.07.2018 / 03:28