33

I tried to run "eclipse-jee-juno-win32-x86_64" , but it raised the following error " java runtime environment JRE or java development kit must be available in order to run eclipse. No java virtual machine was found after searching in the folloiwng location ........ ".

Baring in mind that i have both java jre7 and Java jdk1.7.0_06 installed at C:\Program Files\Java.

The other strange thing also that Eclipse used to run without any problems yesterday , but today i have downloaded the JDK 1.7.0_06 and i set the JAVA_HOME to be "C:\Program Files\Java\jdk1.7.0_06"so i don't know if the problem is related to this ???.

So what might be the problem in running Eclipse? BR

John John
  • 1
  • 72
  • 238
  • 501
  • 3
    Worth noting: if your version of Eclipse is for 64bit systems and your JDK is built for 32bit systems, you'll get the same error. – Buffalo Mar 12 '14 at 12:50

14 Answers14

75

Check the eclipse.ini file and make sure there is no -vm option there that is pointing to a non existing java install now. You can delete the option to let Eclipse figure out what java install to use or change it so it's pointing to the new install.

Strelok
  • 50,229
  • 9
  • 102
  • 115
  • 1
    Thanks for the reply,, there was a "-vmargs" under "openFile" in the "eclipse.ini" file, so i remove it ... but i am still getting the same error when i tried to open Eclipse.. – John John Aug 26 '12 at 09:44
  • 3
    No. Do not remove vmargs option. It's needed. I said to look for the `-vm` option. Check this link on how to specify a vm directly for eclipse to use: http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM – Strelok Aug 26 '12 at 09:50
  • 2
    I have added the following:- -vm C:\Program Files\Java\jdk1.7.0_06\bin\javaw.exe and it works well... BR – John John Aug 26 '12 at 11:33
  • 1
    Might be easier to add java to your path instead. That way eclipse still works after you upgrade versions of java. – Brantley Blanchard Jun 25 '13 at 15:10
  • When the JRE is installed it is automatically in your path. The Oracle JRE installs bootstrap java.exe in your `c:\windows\system32` folder that launches java.exe from where the JRE os installed. – Strelok Jun 25 '13 at 15:34
  • Just a note to those looking for the `eclipse.ini` file: start at the *eclipse* folder in your home (user's) directory and navigate through the subfolders from there. – Lawrence Apr 20 '17 at 07:09
26

This worked with me: Eclipse will not open due to environment variables


Let eclipse use your java vm directly!

Put these lines at the end of eclipse.ini (located in the directory where eclipse.exe is present):

-vm
<your path to jdk|jre>/bin/javaw.exe

Pay attention that there are two lines. Also make sure that the -vm option is before the -vmargs option (and of course after "openFile").

Community
  • 1
  • 1
Hamzeh Soboh
  • 7,572
  • 5
  • 43
  • 54
16

I had this problem before and I solved by :

Right click my computer -> properties -> Advanced system settings.

In both sections :

  • User variables for "YourUser" &
  • System variables

Update the PATH by adding to the end of it a ";" and your java bin folder location , mine was "C:\Program Files\Java\jdk1.7.0_51\bin"

If there is no path then create it using the NEW button, set "Variable Name " to PATH and "Value" to your java bin location.

You can replace your PATH if there is no need for it

NOTE : THE FOLDER BIN SHOULD CONTAIN javaw.exe

Hasan Shouman
  • 2,162
  • 1
  • 20
  • 26
  • 1
    This worked for me! Thank you. Also you left out one step and that is to go to "Environment Variables" after Advanced System Settings. Here's where you'll find the path variable for user and system – user1985189 Nov 05 '14 at 01:36
  • I had this set in my global Environment Variables but not in my User Environment Variables under PATH. That's strange to me but oh well I'm glad this worked! Thanks. – Kyle Bridenstine Jan 11 '16 at 14:53
4

Step 1

My computer > properties > Advance system settings

Step 2

environment variables > click New button under user variables > Enter variable name as 'PATH'

Copy the location of java bin (e.g:C:\Program Files\Java\jdk1.8.0_121\bin) and paste it in Variable value and click OK Now open the eclipse.

PEHLAJ
  • 9,980
  • 9
  • 41
  • 53
3

I faced this issue and it get resolved by following steps.

  1. Open Eclipse.ini file in Notepad
  2. Search vm
  3. Delete non existing JRE path from this file as mention in below

    -vm C:/Program Files/Java/jre1.8.0_181/bin

  4. Save this file and run eclipse again.

Vikas Rathour
  • 231
  • 3
  • 9
1

This problem is because of the fact that eclipse is not able to find Java ,

Check the java directory cd /Library/Java/JavaVirtualMachines///Contents/Home/jre/bin

If thats not present down JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Once JDK is installed change eclipse.ini file

On Mac: Right click on Eclipse icon and click "Show package Content"

Navigate to eclipse>Contents>Eclipse>eclipse.ini

Open the file and replace the java path after "-vm" with this

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/bin

1

I put the JRE folder from the JDK installation directory to the Eclipse installation directory (the folder which contains the eclipse.exe file). It worked for me.

Pang
  • 9,564
  • 146
  • 81
  • 122
iamabhaykmr
  • 1,803
  • 3
  • 24
  • 49
1

open /Users/you/eclipse/java-oxygen right click on eclipse, click on show package content

Then go to Contents/Eclipse and select file eclipse.ini, open in text file or in any editor.

search deleted java path and add newer java path till bin /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin

0

This doesn't seem to be relevant in this case, but in case others face this problem --- make sure that if you installed 32 bit version of Eclipse, you also installed 32 bit version of JRE. Similarly, if you installed 64 bit version of Eclipse, you need 64 bit version of JRE in your Windows. Otherwise you will see the above error message as well.

pkout
  • 6,430
  • 2
  • 45
  • 55
0

If you are using 32 bit eclipse IDE, then u might have to install the "jdk-7u45-windows-i586" version.

i have tried using 64 bit version JDK but no luck!

Thanks,

Puneeth

SuperSaiyan
  • 159
  • 1
  • 4
0

I have tried everything, and finally deleting the -vm options worked for me.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Pau
  • 1
0

ECLIPSE PHOTON ON MAC

  1. Get your current JAVA_HOME path /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

  2. open /Users/you/eclipse/jee-photon/Eclipse.app/Contents/Eclipse/ and click on package content. Then open eclipse.ini file using any text file editor.

  3. Edit your -VM argument as below( Make sure the Java Path is same as $JAVA_HOME)

-vm

/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/bin

  1. save and start your eclipse.
Halieba
  • 11
  • 3
0

For mac :

I have added below two commands its working fine!

-vm
/usr/bin
/usr/libexec/java_home --verbose

Example

Ashish
  • 6,791
  • 3
  • 26
  • 48
0

I got the same error after a Java version update. I just edited the line after "-vm" in the eclipse.ini file, which was pointing to the older and no more existing jre path, and everything worked fine.

Manuel
  • 1
  • 1
  • 2
  • This is more of a comment than a answer, the currently accepted answer from almost 8 years ago suggests the same thing. Instead of commenting in a answer that this worked for you, it is better to upvote the answer when you have the privilege to do so. – JoshMc Apr 15 '20 at 09:25