Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating Java Breaks Eclipse Running

Tags:

java

eclipse

I just updated Java because I got a notification to do so. Now, whenever I try to run something in Eclipse, I get an error: Unable to locate executable for jre1.8.0_20. From my understanding, I should be able to keep the old installation of Java and just point Eclipse at the jre. Is my understanding incorrect? How do I fix this problem?

java -version returns java version "1.8.0_25"

like image 936
ford prefect Avatar asked Oct 21 '14 16:10

ford prefect


People also ask

Why is my Eclipse not starting?

If you've installed Eclipse but are having trouble getting it to run, the most likely cause is that you have not correctly specified the JVM for it to run under. Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse. ini. If $ECLIPSE_HOME is not defined, the default eclipse.

Is Java 11 required for Eclipse?

Current releases of Eclipse require Java 11 JRE/JDK or newer. A Java Development Kit (JDK) includes many useful extras for Java developers including the source code for the standard Java libraries. Regardless of your operating system, you will need to install some Java virtual machine (JVM).

How to fix Eclipse error?

I recommend going to your Problems view, selecting one of the errors, and hitting Ctrl-1 (quick fix). It should offer you the chance to fix all the errors of the selected type, in all files. You can also mouse over the error in the text editor and wait for a popup; it should say "fix 70 other errors of this type".


2 Answers

While the other two answers are technically correct here is slightly more detail.

In your eclipse.ini file (which should be in the same directory as where you installed eclipse) add the lines

-vm
C:/path/to/java/jdk1.8.0_20\jre\bin\javaw.exe

Then save and reopen eclipse

like image 166
ford prefect Avatar answered Oct 16 '22 04:10

ford prefect


In eclipse.ini file use -vm to point javaw.exe file with entire path, where it is available.

like image 43
CuriousMind Avatar answered Oct 16 '22 02:10

CuriousMind