Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 368
Gandalf StormCrow Avatar asked Jan 29 '10 13:01

Gandalf StormCrow


1 Answers

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

like image 145
St.Shadow Avatar answered Oct 08 '22 00:10

St.Shadow