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"

4
  • Go to eclipse and set Default jre which should point to correct path and your are done. Commented Oct 21, 2014 at 17:10
  • Did you look and make sure it did keep the old install of Java? Commented Oct 22, 2014 at 2: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? Commented Oct 22, 2014 at 2: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. Commented Oct 22, 2014 at 23:26

5 Answers 5

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

Sign up to request clarification or add additional context in comments.

1 Comment

As below said put this before your -vmargs line
2

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

Comments

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

1 Comment

Worked for me without pointing to jvm.dll. Using Eclipse Luna 4.4.0
1

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

Comments

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).

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.