7

I have updated my Java to version 10.0.1 and now I can't run Eclipse anymore.

It shows this message:

a java runtime environment (JRE) or Java development Kit(jdk) must be available in order to run eclipse. No Java virtual machine was found after searching the following locations:

C:\Program Files\Java\ire1.8.0_144\bin

I tried from advance settings to insert a new path but doesn't work.

Zabuzard
  • 25,064
  • 8
  • 58
  • 82

3 Answers3

8

Instructions

(ignore that the images don't show Java 10 but Java 9 and 8 instead)

First step is that you need to download a JDK 10 (download). Then set your Windows Path system environment variable to point to the bin directory of your JDK 10 and remove the entry to the old java version (see the tutorial). Looks like this on my end:

path variable

This variable defines where Windows will look for commands. Try it out by typing in java -version into your cmd:

command line

If it reads Java 10 it worked.

After that you need to set your Eclipse to Java 10. Therefore, first add the JDK as possible JRE for Eclipse. Go to Window > Preferences > Java > Installed JREs and add it:

eclipse jres

Last step is that you need to tell your project to use this entry now. Go to Properties > Java Build Path of your project and edit the JRE it uses:

project jre


Eclipse and Java 10

Note that Eclipse does not really support Java 10 yet.

Oxygen has an early draft that supports it, but it may be difficult to get all plugins going. See here.

Photon will support it when released in June. The early build of Photon doesn't support it yet. See here.

Zabuzard
  • 25,064
  • 8
  • 58
  • 82
  • 1
    OP can't even open Eclipse, so your last 2 steps are impossible. Maybe you can suggest a way we can manually edit the Eclipse config files? Perhaps then I won't be forced to downvote =P – Bungler May 03 '18 at 04:26
2

I was able to resolve this issue by updating Eclipse through their installer tool.

First of all, try updating the config of your current installation. It's called eclipse.ini and it's going to be in the original installation directory. Mine looks somewhat like this:

[...]
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jre-10.0.1\bin  <--Change this to the correct JRE path
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]

If that doesn't work, try:

  1. Install JRE 10. Look at the first part of Zabuza's answer for instructions.
  2. Download the Eclipse Installer (http://eclipse.mirror.rafal.ca/oomph/epp/oxygen/R2/eclipse-inst-win64.exe)
  3. Update the installer if it requires one. There will be a notification when you launch it; click it and the installer will update and restart.

In the next window: enter image description here

  1. Choose a product from the list. I chose one that I already had installed.
  2. Change the Eclipse version if you'd like. I stuck with Oxygen.
  3. Browse to where you installed your jre 10 version and click next.

In the next window: enter image description here

  1. Check a project to download if you want. I didn't download any of them. Click next.
  2. Continue through the installation and specify your preference for it's location. I chose to install in the same location. This should not touch any of your project files.
  3. Choose a location for the workspace. I chose the original location.
  4. Eclipse should open with the welcome page. Click File > Open Project from File System, and it will import your project.

  5. You may have to repeat the part at the top and edit the eclipse.ini of at lease check that it is still updated.

Bungler
  • 486
  • 4
  • 12
0

This problem comes when you might have installed two or more different versions of Java on your system and the eclipse read the Configuration setting as the initial Java version which you might or might not have in your system now which u don't want to use.

How to Fix:-

Search for Configuration setting(.ini) file. Manually edit the previous path present just above -vmargs (like C:\Program Files\ jre1.8.0_91\bin) the existing java path as C:\Program Files\ jre1.8.0_251\bin. It will certainly Work!!