Search code examples
javaenvironmentbuildpath

No JREs that are compatible with JavaSE-16


The error below frequently occurs whenever a new Java Project is created. I know how to fix this issue but is there a more permanent solution so that my JDK system library is pre-installed instead of the one provided? Both eclipse and the JDK are installed but do they have to be in the same folder?

"Build path specifies execution environment JavaSE-16. No JREs installed in the workspace that are strictly compatible with this environment."

Before: JRE Installed

After:JDK Installed

I have tried to move my JDK into the system environment variables and have tried to re-install eclipse. I expected a prompt for the build path so that I can manually insert it but that did not occur.

Installation


Solution

  • If you open Eclipse and select Window->Preferences the preferences window will open.

    There you can select Java, and then the sub menu Installed JREs".

    There you can add a new jre/jdk to eclipse.

    Ps: This will just tell Eclipse about an existing jdk. If you have not installed JDK version 16, you will have to download it from Oracle first.