[java] Error :- java runtime environment JRE or java development kit must be available in order to run eclipse

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

This question is related to java eclipse

The answer is


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.


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


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


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


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


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.


For mac :

I have added below two commands its working fine!

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

Example


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.


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.

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


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


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.


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.