How can the JRE be configured in Eclipse?
The method to configure Eclipse JRE is as follows:
- Open the Eclipse IDE.
- Click on the “Window” option in the menu bar, and then select “Preferences”.
- In the pop-up dialog box, expand the “Java” folder and select the “Installed JREs” option.
- Click on the “Add” button on the right side.
- In the pop-up dialog box, select “Standard VM” and click the “Next” button.
- In the “JRE home” field, click on the “Directory” button and select the folder where the JRE is located. For example, if the JRE is in the folder C:\Program Files\Java\jre1.8.0_201, then choose that folder and click on the “OK” button.
- Make sure the “JRE name” field displays the correct JRE version number, and then click the “Finish” button.
- In the “Installed JREs” dialog box, make sure the newly added JRE is selected and click the “OK” button.
- In Eclipse, right-click on the project name in the project, and select “Properties”.
- Choose the option “Java Build Path” in the popup dialog box.
- Click the “Add Library” button in the “Libraries” tab on the right side.
- In the pop-up dialog box, select “JRE System Library” and click the “Next” button.
- Select the added JRE version from the drop-down menu and then click on the “Finish” button.
- Make sure the newly added JRE is selected, and click on the “Apply” and “OK” buttons to save the changes.
In this way, you have successfully set up Eclipse’s JRE.