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"
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.
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).
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".
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
In eclipse.ini file use -vm
to point javaw.exe file with entire path, where it is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With