0

I have been having trouble with Java for my studies. I downloaded the latest version of the JDK, JDK 14. Now I tried to install Eclipse, it states that I do not have a JVM. So I am trying to download the JRE for it, but there is none. Can anyone recommend to me what I should do? Or do I need to uninstall the newest version and download a lower version?

Basil Bourque
  • 218,480
  • 72
  • 657
  • 915
Kei
  • 11
  • 3
  • You don't need a JRE. Just put the JDK `bin` folder on the PATH, preferably first. --- Alternatively, tell Eclipse where to find it. See: [Setting the correct PATH for Eclipse](https://stackoverflow.com/a/35884352/5221149). – Andreas Apr 15 '20 at 21:07
  • Always search Stack Overflow thoroughly before posting. – Basil Bourque Apr 15 '20 at 23:42

1 Answers1

2

No.

a JDK is a superset of a JRE; anything a JRE can do, a JDK can do. There is never any reason to install a JRE and there never has been*.

JREs are intended for 'end users' (non-coders who just want to run java apps, not write them or debug them). The model where you write an app and distribute some jars, and the user that receives your desktop java app is then responsible for having a java virtual machine on their machine (and they are responsible for keeping it up to date, secure, etc) – is dead. It died with JDK9. Officially. Replaced by jlink and such. That's why JDK9 has no JRE, nor do any versions after wards, and they never will again.

Because, starting with JDK9, you are responsible for that VM. You install it, you update it. jlink and co. help with this.

Eclipse, intellij, etc tend to still rely on you installing a JDK yourself; after all, you need one to develop java, so might as well use that. The point is, eclipse has run on JDKs since forever.

If the eclipse installer has issues finding your VM, that's possibly because JDK14 is brand new and whilst the latest version of eclipse does support it, maybe you have an older one. I suggest trying JDK11 (you really shouldn't run java apps on not-JDK11/JDK8; you'd want a long-term support version). Eclipse is perfectly fine running on JDK11, whilst you have a project that compiles against, and only runs on, JDK14. You can still run it, debug it, etc.

rzwitserloot
  • 44,252
  • 4
  • 27
  • 37