In my specific case, I had a Maven project loaded in Eclipse Mars, and when I tried to run a specific main class, the project itself did not appear in the list of projects in the section:
Configurations -> Java Application -> Project -> Overview ...
What I did was just convert the project to Borders ... in the Project Properties:
Main menu → Project → Properties → Project boundaries
As soon as I did this, they just selected Java and the version I needed, and it started working.
source share