Eclipse will not open due to environment variables [duplicate]

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?


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


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.


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 ?