1

In Eclipse 2018-12, when the JDK 11 root directory is selected using the search button at Windows -->Preferences--Java--Installed JREs, Eclipse says "No JREs found". But JDK 11 can be added to the list of installed JREs by using the Add button. But when added what appears under the Name column of the Installed JREs box is JDK 11.0.2, not a JRE. When one goes through the search button and the root directory of JDK 8 is selected, the message that says no JREs is not displayed and its JRE is very smoothly added to the installed JREs list. For JDK 11, to be added to the list of installed JREs the Add button has to be used, not the search button. I would like to know what this means?

JDK 11 appears first in the Path variables of the user variables list. After JDK 11, appears JDK 8. Even if Java 11 is returned for the command java -version Eclipse still says no JREs found in JDK 11. In the JDK 11.0.2 root folder, no jre folder is found.

Even though this question is marked as a duplicate, it's not so. This question is about why Eclipse is behaving in a certain way regarding JDK 11 that's different from its behaviour regarding JDK 8.

Varuna
  • 1,343
  • 3
  • 15
  • 30

3 Answers3

4

I have never used the Search button (I always add JREs via the Add button) but I suspect that the button behavior was not updated for JDK 11. Since JDK 9, there is no more jre folder anymore. So, it continues seeking for jre folder and since there is no, it fails.

In any way, I don't see any big reason to use the Search button. Just use the Add button.

ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
  • But why wasn't JDK -11 added to the list of Installed JREs when Eclipse was restarted after Path variables were updated and the command java -version returned java version "11.0..-..." – Varuna Feb 17 '19 at 08:19
0

The answer to the above question may be found at On Windows, installing Java 11. Part of it is as follows. I now think that the page led to by the link above is not the right answer.

On Windows, installing Java 11 may not fix your problem. The Oracle Java 11 installer does not appear to register itself as the default JRE on the system path, or place its entries in the expected location of the system registry.

As such, even if you plan to use Java 11 in your development environment, you should consider also installing Java 8 so that your system path has a JRE/JDK usable as the default for any current or older Eclipse version.

But why wasn't JDK -11 added to the list of Installed JREs when Eclipse was restarted after Path variables were updated and the command java -version returned java version "11.0..-..." My question is why didn't anybody knowledgable about this issue didn't reply. Some marked the question as duplicate even.

Varuna
  • 1,343
  • 3
  • 15
  • 30
-2

Go to to your Java folder and check if you've a jre folder inside, otherwise just download JDK again and reinstall.

  • I have downloaded and installed JDK-11 several times now, but no change. IntelliJ automatically adds JDK-11 as its SDK but not Eclipse 2018-12 – Varuna Feb 11 '19 at 12:12
  • Wait, did you setup your JAVA environment variables, after installing JDK? – Thapelo Masethe Feb 11 '19 at 12:14
  • Go into JDK-11 and see the difference between JDK-8 root folder contents and JDK-11's contents.Is there a JRE in JDK-11 or not.Is this the difference that's causing this confusion. – Varuna Feb 11 '19 at 12:16
  • Yes, By typing javac -version, what gets returned is javac 11.0.1 – Varuna Feb 11 '19 at 12:18