Praveena,
When creating a java project, change the value for “Use Execution environment JRE” to the desired value.
For an existing project you can right click on your project and go to properties. In the new window that opens, select Java Compiler. Check “Enable Project Specific Settings”, uncheck “Use Compliance From Execution Environment …” and change the compiler compliance level accordingly.
Let me know if that helps