Eclipse IDE - Error: Build path specifies execution environment Java SE 1.7

前端 未结 8 1278

In Eclipse, I am getting an error:

Build path specifies execution environment Java SE 1.7.
There are no JREs installed in the workspace that are st

8条回答
  •  庸人自扰
    2021-02-04 02:05

    I have this situation because I have multiple JDKs, and the JREs are nested below them. I'm building a JRE8 project but my current default is the latest v11. So the challenge is to get Eclipse to recognize the JDK>JREv8.

    1. Go to Preferences > Java > Installed JREs.
    2. Click Add.
    3. Navigate to the JRE under the JDK, which in my case is C:\Program Files\Java\jdk1.8.0_152\jre.
    4. Change the JRE name to JDK8 JRE8 just for clarity.
    5. Click Finish.

    On build the error goes away. :)

提交回复
热议问题