Eclipse will not open due to environment variables

JavaEclipseEnvironment Variables

Java Problem Overview


I just rebooted my computer without changing anything. Suddenly I can't open Eclipse. Instead, I get this error message:

┌──────────────────────────────────────────────────────────────────────┐
│ Eclipse                                                              │
├──────────────────────────────────────────────────────────────────────┤
│                                                                      │
│   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:\Users\emiri\Downloads\eclipse\jre\bin\javaw.exe                 │
│   javaw.exe in your current PATH                                     │
│                                                                      │
│                                                      ┌────────────┐  │
│                                                      │     OK     │  │
│                                                      └────────────┘  │
└──────────────────────────────────────────────────────────────────────┘

And I see all my environment variables have been erased. java, javac, mvn, etc. don't work. What do I do now, and how do I fix this?

Java Solutions


Solution 1 - Java

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

Useful link Eclispe.ini at wiki.eclipse.org

Solution 2 - Java

I think I found an easier way (for me anyway). Locate your javaw.exe file (either by searching for it or just where you installed it), then drag the javaw.exe file onto the eclipse.exe file and it will use it.

Solution 3 - Java

Here is the answer, sorry .. but your solutions weren't correct

set PATH=C:\Program Files\Java\jre1.6.0_03\bin ;%PATH%

paxdiablo Did you rewrite the error or you got some kind of software reading text from image, if you got which one ?

Solution 4 - Java

First uninstall all java software like JRE 7 or JRE 6 or JDK ,then open the following path :

> START > CONTROL PANEL > ADVANCED SETTING > ENVIRONMENT VARIABLE > > SYSTEM VARIABLE > PATH

Then click on Edit button and paste the following text to Variable_Value and click OK.

>C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows > Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program > Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files > (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files > (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft SQL > Server\100\Tools\Binn\VSShell\Common7\IDE;C:\Program Files > (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft > SQL Server\100\Tools\Binn;C:\Program Files (x86)\Microsoft SQL > Server\100\DTS\Binn\

Now go to this url http://java.com/en/download/manual.jsp and click on Windows Offline and click on run and start again eclipse.

Enjoy it!

Solution 5 - Java

Another alternative is to re-run the JRE setup. It typically installs a default JRE by placing java.exe, javaw.exe, etc. in your system folder. That would place the executables in your path, which should be sufficient, based on the note in the error message that it searched your path for javaw.exe

Solution 6 - Java

Ok...Ok... Don't worry i am also ruined by this error and fatal and when i got it i was so serious even i was not giving an attention to other work, but i got it, Simply first of all copy this code and paste in your system variable Under path ...

> C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\Program > Files\Java\jre6\bin\javaw.exe

Now copy the "jre" folder from your path like i have have "jre" under this path

            C:\Program Files\Java

and paste it in your eclipse folder means where your eclipse.exe file is placed. like i have my eclipse set up in this location

    F:\Softwares\LANGUAGES SOFTEARE\Android Setup\eclipse

So inside the eclipse Folder paste the "jre" FOLDER . If you have "jre6" then rename it as "jre"....and run your eclipse you will got the solution...

   //<<<<<<<<<<<<<<----------------------------->>>>>>>>>>>>>>>>>>>                 

OTHER SOLUTION: 2

If the problem could't solve with the above steps, then follow these steps

  1. Copy the folder "jre" from your Java path like C:\Program Files\Java\jre6* etc, and paste it in your eclipse directory(Where is your eclipse available)
  2. Go to eclipse.ini file , open it up.
  3. Change the directory of your javaw.exe file like

> -vmF:\Softwares\LANGUAGES SOFTEARE\Android Setup\eclipse Indigo version 32 Bit\jre\bin/javaw.exe

Now this time when you will start eclipse it will search for javaw.exe, so it will search the path in the eclipse.ini, as it is now in the same folder so, it will start the javaw.exe and it will start working.

If You still have any query you can ask it again, just go on my profile and find out my email id. because i love stack overflow forum, and it made me a programmer.*

Solution 7 - Java

Eclipse and Java JDK (or JRE) must match regarding the BIT Version

For example:

32 Bit Eclipse won't work with 64 Bit Java!

32 Bit Eclipse needs 32 Bit Java!

Solution 8 - Java

very easy, you just copy the folder 'jre' to the folder that you put eclipse. That'all. Jre is the environment, normally it's location in the C:/Programing Files/Java/jre :D

Solution 9 - Java

You should install both 32bit & 64bit java (At least JRE), that in case you're using 64bit OS.

Solution 10 - Java

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
**-vm
C:/Program Files (x86)/Java/jdk1.7.0_45/bin/javaw.exe** =>false
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-vm
C:\Program Files (x86)\Java\jdk1.7.0_45\bin\javaw.exe

Solution 11 - Java

java problems solved when I updated my 64bit Java (i'm using 64bit W7 & 64bit eclipse 4.4.0):

http://www.java.com/en/download/manual.jsp

Recommended Version 7 Update 67 Windows Offline (64-bit) filesize: 29.5 MB

Solution 12 - Java

Copy jre folder present in "C:\Program Files\Java" directory into eclipse folder.. i.e, C:\eclipse\

Solution 13 - Java

It may be bacause you do not have jre installed. Thus go to http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html and download it.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGandalf StormCrowView Question on Stackoverflow
Solution 1 - JavaSt.ShadowView Answer on Stackoverflow
Solution 2 - JavaChuckView Answer on Stackoverflow
Solution 3 - JavaGandalf StormCrowView Answer on Stackoverflow
Solution 4 - JavaNasiraliView Answer on Stackoverflow
Solution 5 - JavaPhil HaywardView Answer on Stackoverflow
Solution 6 - JavaPir Fahim ShahView Answer on Stackoverflow
Solution 7 - JavaMeJView Answer on Stackoverflow
Solution 8 - JavabinhView Answer on Stackoverflow
Solution 9 - JavaIWIHView Answer on Stackoverflow
Solution 10 - Javauser3068564View Answer on Stackoverflow
Solution 11 - JavaafinnView Answer on Stackoverflow
Solution 12 - JavaMark NicholasView Answer on Stackoverflow
Solution 13 - JavaJohn VelandiaView Answer on Stackoverflow