In Eclipse,
go to Project > Properties
From left hand side, click Java Compiler.
Make sure that "Enable project specific settings" is checked.
Select "Compiler compliance level" equilent to JDK library you have included in your build path.
In your case it should be 1.7.