If your project is not a Maven project, right-click on your project and choose Properties to open the Project Properties dialog.
There is a Project Facets item on the left, select it, look for the Java facet on the list, choose which version you want to use for the project and apply.