If you want to update an Eclipse project to use a specific Java Runtime Environement (JRE) then you must first install a JRE on your operating System by following the instructions at Installing Java Runtime Environment 1.7 (JRE1.7) Next, follow the instructions below:

  1. Open Eclipse
  2. Right-click on the specific project -> Preferences -> Java -> Java Build Path
  3. Select Add Library -> JRE System Library -> One of the following:
    1. If your workspace is using the desired JRE, then select Workspace Default JRE
    2. 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 Installing Java Runtime Environment 1.7 (JRE1.7)
  4. If there is another JRE listed in the Java Build Path/Libraries tab, remove it (e.g. remove JRE1.5)
  5. Select Java -> Compiler -> Compiler Compliance Level -> Select the JRE you just installed
  6. Select Java -> Compiler -> Compiler Compliance Level -> De-select Use Default Compliance Settings
  7. On the same screen, next to Generated .class files Compatibility, select the newly installed JRE from the dropdown
  8. On the same screen, next to Source Compatibility, select the newly installed JRE from the dropdown
  9. Select OK in the Preferences Dialog and your done.

Leave a Reply

Your email address will not be published. Required fields are marked *