Can't run Eclipse with Java 10.0.1
Asked Answered
H

3

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.

Heath answered 30/4, 2018 at 22:28 Comment(6)
have you configured Java10 path for your Eclipse? Seems like you remove your Java8Squarerigged
ire in the path? Not jre? Looks like a typo to me.Blear
yeah sorry its jre and yes i removed Java8.I dont know how to configured Java10 pathHeath
What version of Eclipse do you use?Devisor
Possible duplicate of How to set up java 10 in Eclipse Oxygen?Indigotin
@Blear Same problems for Eclipse Photon after Java 10 installation not even opening anymore ....Assimilate
E
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.

Epidote answered 30/4, 2018 at 23:27 Comment(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 =PHartford
H
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.

Hartford answered 3/5, 2018 at 5:5 Comment(0)
F
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!!

Fortalice answered 30/6, 2020 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.