Proper build path is required for compiling and building java project.
1. Right Click on your project folder, Choose Build Path > Configure Build Path
Right Click on your project folder, Choose Property > Java Build Path
For both cases you will find the same option panel like:
2. Select “JRE System Library” and select Edit from the right side bar
3. Choose your right Version of java installed
And hit finish and Refresh the project
1. Step 1 is Same as the previous method
2. Select Libraries Tab and delete any arbitrary library present there.
3. Click on Add Library option, Select JRE System Library and click Next.
4. Select the option Workspace default JRE and click Finish.
Right click on project and select Refresh.