0

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

HoRn
  • 1,458
  • 5
  • 20
  • 25
Abdullah
  • 23
  • 1

1 Answers1

1

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.

MTilsted
  • 5,425
  • 9
  • 44
  • 76
  • Thank you for the help. I also figured out that you can select the default JRE when creating the java project. Do you have any way to do the same for JUNIT. As in, when creating a java project, it has JUNIT already in the ClassPath? – Abdullah Nov 02 '22 at 19:23
  • @Abdullah, if you like the answer, please mark it as the correct one – HoRn Nov 03 '22 at 05:43