3

I am trying to use eclipse juno and keep getting errors even after reading many pages here.

I get the following error when I try to start eclipse with the command line using C:\Users...\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe" -data C:...\workspace

"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: %JAVA_HOME%\bin\javaw.exe"

I get the following error when I try to start eclipse with the eclipse icon.

"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:...\jre\bin\javaw.exe javaw.exe in your current path"

I have tried setting the path, but it doesn't seem to help. Will somone help me by explaining where to put the jre folder and whether to set the path or pathclass or how to set java home... I'm confused. Thank you!

user2717693
  • 33
  • 1
  • 1
  • 5
  • [Reference](https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows) for setting JAVA_HOME – thar45 Aug 27 '13 at 13:28

2 Answers2

5

Please try this command in windows command line and check if it outputs the correct path.

   echo %JAVA_HOME%

It should point to something like - C:\Program Files\Java\jdk_version If it is not, then you should follow these steps properly.

Also check if your PATH is properly set.

   echo %PATH%

It should include %JAVA_HOME%\jre\bin If it is not, then you should follow these steps properly.

Once all the above steps are properly done, the Eclipse should start by directly clicking the icon.

Chetan Gole
  • 703
  • 2
  • 14
  • 26
  • Hello Chetan, thank you for the help! I installed the jdk, and the "echo %JAVA_HOME%" command gives the correct result. I checked my PATH with the "echo %PATH%" command but I don't see the words "%JAVA_HOME%" in the PATH, but there is an entry "C:\....\javaw.exe". Do the words "%JAVA_HOME%" have to be used? Thank you for your help! – user2717693 Aug 27 '13 at 14:06
  • No it should not contain %JAVA_HOME%. It should have path till "C:\Program Files\Java\jdk_version\bin" and should *not* include the "javaw.exe" – Chetan Gole Aug 27 '13 at 14:16
  • Hello again, Chetan, Thank you! The "echo %PATH%" command gives the right result now. I see the eclipse splash screen when I click on the eclipse icon, but also a new error message: "Failed to load the JNI shared library "C\....\jdk1.70_25\bin..\jre\bin\client\jvm.dll". I checked and the jvm.dll file is there. Do you have any suggestions? Thanks again! – user2717693 Aug 27 '13 at 14:26
  • Try re-installing the Java. Or may be you should try other version of installer. I think the installer is corrupted. – Chetan Gole Aug 27 '13 at 14:34
  • shouldn't the JRE installer create this path automatically? – endolith Sep 19 '14 at 15:30
2

I too received the same error white starting STS. the solution is simple:

  1. First of all check if you have jdk installed or not. (I guess you do). If not then install it right now and copy the javaw.exe file from program files in your C:\Users...\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\ location.

  2. Go to your variable path and check if your jdk is listed there or not. If not include it. C:\Program Files\Java\jdk1.8.0_121\bin

  3. Retry. It will hopefully run. And if you are still getting the error, then most probably it's because you are using a wrong jdk (32 bit or 64 bit). Reinstall the correct one.

This will surely eliminate the error. Enjoy

ascripter
  • 5,665
  • 12
  • 45
  • 68