If the project has been already started with JDK 1.6, you have to change also the project level settings, so :
Project ---> Properties ---> Java Compiler : set compliance level and Source compatibility to 1.7
Project ---> Properties ---> Java Build Path ---> Libraries ---> and change the JRE system library to 1.7
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…