- Install a JRE on your operating System https://spragucm.wordpress.com/2015/05/11/installing-java-runtime-environment-1-7-jre1-7/
You installed a JRE on your operating system and want to update a single Eclipse project to use the new JRE.
- Open Eclipse
- Right-click on the specific project -> Preferences -> Java -> Java Build Path
- Select Add Library -> JRE System Library -> One of the following:
- If your workspace is using the desired JRE, then select Workspace Default JRE
- If your workspace is not using the desired JRE, select Alternate JRE, and the desired JRE from the dropwdown menu. If the desired JRE is not listed in the dropdown then ensure it was correctly installed by following the instructions at https://spragucm.wordpress.com/2015/05/11/installing-java-runtime-environment-1-7-jre1-7/
- If there is another JRE listed in the Java Build Path/Libraries tab, remove it (e.g. remove JRE1.5)
- Select Java -> Compiler -> Compiler Compliance Level -> Select the JRE you just installed
- Select Java -> Compiler -> Compiler Compliance Level -> De-select Use Default Compliance Settings
- On the same screen, next to Generated .class files Compatibility, select the newly installed JRE from the dropdown
- On the same screen, next to Source Compatibility, select the newly installed JRE from the dropdown
- Select OK in the Preferences Dialog and your done.