54

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?

MultiplyByZer0
  • 6,302
  • 3
  • 32
  • 48
Gandalf StormCrow
  • 25,788
  • 70
  • 174
  • 263
  • 1
    Could you *write* the error message? (tinypic.com is blocked at work) – VonC Jan 29 '10 at 13:18
  • I woudl guess that whatever user you were logged in as before is not the user you are now. That's why none of your environment is the same - but, it's just a guess. – KevinDTimm Jan 29 '10 at 13:18
  • 1
    Here's the error message: 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 – Phil Hayward Jan 29 '10 at 13:39
  • Thank you. I just saw your edit. See http://blog.stackoverflow.com/2010/01/new-improved-comments-with-reply/ for notification ;) – VonC Jan 29 '10 at 13:52
  • 4
    Upvote for awesome ASCIIART – Alec Teal Dec 05 '13 at 03:59

13 Answers13

88

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

Stan
  • 2,151
  • 1
  • 25
  • 33
St.Shadow
  • 1,840
  • 1
  • 12
  • 16
  • 7
    Much more *complete* `eclipse.ini`: http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse/1409590#1409590 – VonC Jan 29 '10 at 13:22
  • Really, cool configuration. Need try it. – St.Shadow Jan 29 '10 at 13:38
  • I haven't been able to get this to work yet but I did find some more info on configuring the Eclispe.ini - http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#eclipse.ini – Daniel Ballinger Dec 07 '11 at 02:44
  • 1
    In ubuntu, use /bin/java – Pravesh Jain Aug 28 '14 at 12:52
  • For me, I didn't have Java installed on new machine... thanks. After installation, I added the contents into the .ini file as advised. – Chagbert Jul 20 '16 at 14:21
  • After _fresh_ java installation in _most_ cases you don't need to do anything special as java installator will set environment variables and eclipse will rely on them. But direct vm specification won't harm (and honestly I prefer this way because then I exactly know on which jvm my eclipse is running (I used to have a couple of them)) – St.Shadow Jul 20 '16 at 20:15
  • This should be done by the Oomph Eclipse Installer by default so I don't have to fiddle with configuration arguments – Chris Sep 03 '16 at 08:39
  • It depends how your java has been installed (if at all). for example I used to unzip it somewhere on filesystem, so how will Oomph find it? ;) – St.Shadow Sep 03 '16 at 12:16
24

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.

Chuck
  • 241
  • 2
  • 2
18

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 ?

Gandalf StormCrow
  • 25,788
  • 70
  • 174
  • 263
4

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!

Parvin Gasimzade
  • 25,180
  • 8
  • 56
  • 83
Nasirali
  • 49
  • 1
  • 1
2

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.*

Pir Fahim Shah
  • 10,505
  • 1
  • 82
  • 81
2

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!

MeJ
  • 1,088
  • 10
  • 18
2

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

Phil Hayward
  • 327
  • 1
  • 4
1

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

binh
  • 21
  • 1
1

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

IWIH
  • 417
  • 5
  • 17
0
-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
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
0

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

afinn
  • 1
0

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

Mark Nicholas
  • 33
  • 1
  • 7
-1

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.

John Velandia
  • 129
  • 1
  • 4