5

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"

Mario Cervera
  • 671
  • 1
  • 8
  • 19
ford prefect
  • 7,096
  • 11
  • 56
  • 83
  • Go to eclipse and set Default jre which should point to correct path and your are done. – prashant thakre Oct 21 '14 at 17:10
  • Did you look and make sure it did keep the old install of Java? – nitind Oct 22 '14 at 02:01
  • No I don't think it did @nitind but that would mean it would just have both jre's still in the program files right? – ford prefect Oct 22 '14 at 02:02
  • If it were kept, yes. If it wasn't kept, then you have stale references to it on the `Installed JREs` preference page, and any project and launch configuration that referenced it by its `Installed JREs` name. – nitind Oct 22 '14 at 23:26

5 Answers5

7

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

ford prefect
  • 7,096
  • 11
  • 56
  • 83
2

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

CuriousMind
  • 3,143
  • 3
  • 29
  • 54
2

I had the exact same problem. After looking at this answer: Eclipse returns error message "Java was started but returned exit code = 1" the key for me was to move the -vm line above the -vmargs entry in the eclipse.ini and to point it to bin\server\jvm.dll instead of bin\javaw.exe

Community
  • 1
  • 1
Curtis
  • 1,189
  • 2
  • 11
  • 22
1

look in the eclipse.ini file, that's where it specifies the JVM to run with.

Rocky Pulley
  • 22,531
  • 20
  • 68
  • 106
1

As you didn't tell us which version of eclipse are you using, the way that I solve this problem is to remove the line in eclipse.ini file:

-Dsun.lang.ClassLoader.allowArraySyntax=true

This worked for me (eclipse-jee-luna-R-win32-x86_64.zip).

Unihedron
  • 10,902
  • 13
  • 62
  • 72
terrorizer
  • 11
  • 1
  • This question was asked a month ago and has an accepted answer, which means that the problem has been solved. I checked the web and found advise to add this line to circumvent a bug in jdk1.6, so it is safe to assume that you can remove it when upgrading to a newer jdk. It's not put there by default so it shouldn't really be there unless you put it there yourself. – Klas Lindbäck Nov 27 '14 at 14:56