Updating an Eclipse project to use a specific Java Runtime Environment (JRE)

Helpful? Then DOWNLOAD and RATE my app!

Helpful? Then DOWNLOAD and RATE my app!

Prerequisites

Problem

You installed a JRE on your operating system and want to update a single Eclipse project to use the new JRE.

Solution

  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 https://spragucm.wordpress.com/2015/05/11/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.
Helpful? Then DOWNLOAD and RATE my app!

Helpful? Then DOWNLOAD and RATE my app!

 

Advertisements

One thought on “Updating an Eclipse project to use a specific Java Runtime Environment (JRE)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s