Accepted answer

eclipse will by default try to launch with the default "java.exe" (the first one referenced by your path)

three things to remember:

  • "installing" a jre or a jdk can be as simple as unzipping or copying it from another computer: there is no special installation steps, and you can have as many different jvm versions (1.4, 5.0, 6.0...) as you want, "installed" (copied) almost anywhere on your disk.
  • i would recommend to always run eclipse with the lastest jre possible (to benefit from the latest hotspot evolutions). you can:
  • the jvm you will reference within your eclipse session is not always the one used for launching eclipse because:
    • you only need a jre to launch eclipse, but once eclipse launched, you should register a jdk for your projects (especially for java sources and debugging purposes, also in theory for compilation but eclipse has its own java compiler) note: you could register just a jre within eclipse because it is enough to run your program, but again a jdk will allow for more operations.
    • even though the default registered java in eclipse is the one used to launch the session, you can want to register an older sdk (including a non-sun one) in order to run/debug your programs with a jre similar to the one which will actually be used in production.

installed jres

june 2012, jmbertucci comments:

i'm running windows 7 64-bit and i had the 32-bit jre installed. i downloaded eclipse 64-bit which looks for a 64-bit jre. because i didn't have the 64-bit jre it threw the error, which makes sense.

i went to the java manual install page (which was not as directly accessible as you'd like) and installed the 64-bit version. see "java downloads for all operating systems". that was all i needed.

april 2016: steve mayne adds in the comments:

i had to edit the eclipse.ini file to reference the correct java path - eclipse doesn't use the environment path at all when there is a value in eclipse.ini.


just download the java runtime environment (jre). that worked for me!


check window > preferences > java > installed jres. make sure there's something there; if there isn't, add one.

did you recently update your jdk?


the jdk does not install a jvm in the default path.

unless you need external tools to run like ant, the non-jdk is enough for eclipse to run. the easiest way to install such a jvm is to go to and let it install whatever it want to install.

then double-click the eclipse binary again.


set java_home variable and ad java_home/bin to evnrionment path variable.


i had the same issue (windows 7 x64, 64bit jdk, 32bit eclipse), and i found 2 solutions:

  • install the 64 bit version of eclipse (found by clicking the "development builds" tab on the downloads page.)
  • install the 32bit version of the jdk.


i had the same problem. the easy way, for me to fix it was to install both the jre and the eclipse as x86 or x64. when their bit type did not match, eclipse could not find it. so, if it is not a big deal for you to uninstall and reinstall in order to make them match, i would do that.

i ended up installing: java runtime environment (64-bit) and eclipse indigo (3.7) (64-bit)

then it just works.


when i copied only javaw, the second error occured, there is not a java.dll file, when i copied it too, eclipse did not start, what i did was that i copied whole jdk folder to eclipse folder and renamed id to jre. problem solved.


one problem is the conflict between the eclipse-64bit version and our java installation being 32bit version. this doesn't get solved easily because the java installation page doesn't give the option for 64bit - it assumes 32bit and downloads and installs the 32bit version. to overcome this issue, please follow the following steps:

  1. download the 64bit version by going to java se runtime environment 7 (this link gives us the option to download a 64bit version of java). download and install this.
  2. now, trying to install eclipse will still throw an error. so, we copy the jre7 folder from c:/program files/java/ and copy it in our eclipse installation folder.
  3. now, we rename it to jre.

install eclipse.

--launcher.appendvmargs -vm c:\program files\java\jdk1.7.0_79\jre\bin\javaw.exe -vmargs


first go to computer then properties then advanced system settings then advanced

(3rd menu)

and then click environment variables button at the bottom.

to path in environment variables you add:

c:\program files\java\jdk1.8.0_102\bin\;c:\program files\java\jdk1.8.0_102\lib\; 

and the error will go away. this is the best one.

the other way is to copy the jre folder (c:\program files\java\jre1.8.0_102) to


folder. then the error will go away.


i have a simple solution to this problem. i solved it by changing vm path in eclipse.ini file to latest jre path.

i follwed this link :


try setting your java_home to the correct folder. google for setting environment variables in windows.


i had a co-worker with this exact problem last week. he fixed it by installing the x64 version of eclipse and the x64 jdk.

edit: he reused his old workspace after installing the necessary plugins, so that should not be much of an issue


there is an easier way to do that. just run cmd x64. type cmd x64 to search bar in start menu ant you will find it :) or alternatively, you should set path to program files (x86) ... for example c:\program files (x86)\java\jre6


just add the jre path for ex: c:\program files\java\jre5\bin in the environmental variable put ";" in between every path. then click the eclipse.exe it will work.....


the reason you get this error is because eclipse needs a jre to launch, which it can't find. the first place it searches is the current directory, then the eclipse.ini file and then finally the system path. so if the it can't find the correct jvm(bit versions are different) through any of these three places, it cribs

the recommended way is to edit the eclipse.ini file and tell eclipse where exactly to look for the vm/jre, by including this line in the file:

[path to your java.exe] (which is generally under "c:\program files\java\jre7\bin")

p.s. to edit the eclipse.ini, you may need to move the it, edit and then paste it back

source:- wiki


first of all thanks to youyou for his solution! i tried answer by youyou ( initially, it did not work for me. following are the steps that i needed to take to make it work:

  1. initially, i did not have java installed on my new machine. so, i had to install that (downloaded from:
  2. i am running 64-bit os. but, while downloading, i got the message which could help me in choosing which version of java to download: choose the 32-bit download to use with a 32-bit browser. hence, i downloaded 32-bit version.
  3. then, i followed the procedure mentioned in, hoping to get the solution.
  4. i got some other error: java was started but returned exit code=13
  5. then, i installed 64-bit version of java.
  6. copied javaw.exe from that version.

...and eclipse started working!!! yaay!


well this answer is to those who tried all of them others an still no luck, may this be android studio or eclipse i usually do this when everything else fails.

  1. find your android sdk folder and open the android.bat file with a text editor
  2. you will find some commands like these in the start of the file,

set java_exe=

call lib\find_java.bat

if not defined java_exe goto :eof

  1. change them to

    set java_exe= <the path to your java.exe file(can be found inside your jdk folder/bin directory)>

  2. find the lines

rem set swt.jar path based on current architecture (x86 or x86_64) for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a

  1. replace it with set swt_path=<the path to your respective swt.jar file, for x86 it is at sdk\tools\lib\x86 and for x64 at sdk\tools\lib\x86_64>
  2. save and close the file and now you are good to go..


i have run into this problem too. my case is as following:

enter image description here enter image description here

in text:

    path    reg_sz    %java_home%\bin;c:\programfiles\nodejs

hkey_local_machine\system\currentcontrolset\control\session manager\environment
    java_home    reg_sz    c:\programfiles\java\jdk
    path    reg_expand_sz    c:\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\
windowspowershell\v1.0\;c:\program files\intel\dmix;c:\program files (x86)\microsoft sql server\90\tools\binn\;c:\progra
m files (x86)\perforce;c:\programfiles\010 editor;c:\program files\microsoft sql server\130\tools\binn\;c:\programfiles\
git\cmd;c:\program files (x86)\skype\phone\

c:\users\ssfang> echo %^java_home% = "%^java_home%" = %%java_home%% %java_home%
%java_home% = "%^java_home%" = %c:\programfiles\java\jdk% c:\programfiles\java\jdk

i found their types of the registry value path are different, so i checked whether the path is valid or not by the following command:

c:\users\ssfang> where node java
info: could not find "java".

as a result, i reset the local (current user) environment by the following commands (setx):

c:\users\ssfang> setx path %^java_home%\bin;"c:\programfiles\nodejs"

success: specified value was saved.

c:\users\ssfang> reg query hkey_current_user\environment /v path

    path    reg_expand_sz    %java_home%\bin;c:\programfiles\nodejs

c:\users\ssfang> where node java
info: could not find "java".

c:\users\ssfang>echo %path%
c:\bin;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program fi
les\intel\dmix;c:\program files (x86)\microsoft sql server\90\tools\binn\;c:\program files (x86)\perforce;c:\programfile
s\010 editor;c:\program files\microsoft sql server\130\tools\binn\;c:\programfiles\git\cmd;c:\program files (x86)\skype\

but, in the current process, it cannot propagate those changes to other running processes.

however, if you directly modify user environment variables in the registry editor,

those modifications to the environment variables do not result in immediate change. for example, if you start another command prompt after making the changes, the environment variables will reflect the previous (not the current) values. the changes do not take effect until you log off and then log back on.

to effect these changes without having to log off, broadcast a wm_settingchange message to all windows in the system, so that any interested applications (such as windows explorer, program manager, task manager, control panel, and so forth) can perform an update.

see details at how to propagate environment variables to the system

here, i give a powershell script to do it:

# powershell -executionpolicy bypass -file
# standard, inline approach: (i.e. behaviour you'd get when using & in linux)
# start /b cmd /c call "foo.bat" [args [...]]
# powershell -executionpolicy bypass -windowstyle hidden -file myscript.ps1 

add-type @'

public class csharp
    public static void method(object[] first, object[] second)
        system.console.writeline("hello world");
$a = 1..4;
[string[]]$b = "a","b","c","d";
[csharp]::method($a, $b);



#problem add-type : cannot add type. the type name 'pinvoke.user32' already exists.

if (-not ("myclass" -as [type])) {
    add-type @"
    public class myclass { }

p.s. there's no remove-type; see this answer for more on how to best work around this limitation:

i think it will be wanted when debugging.
it is much simpler to close a tab in console and open new one in powershell_ise.exe or close powershell.exe.


start-job -scriptblock {
    # download and save pages
    invoke-restmethod $url | out-file "$outputdir\$($url.segments[-1])" -force
} -argumentlist $link,$outputdir

if (-not ([]'pinvoke.program').type)
using system;
using system.runtime.interopservices;
using system.text;
using system.collections.generic;

// the global namespace is the "root" namespace: global::system will always refer to the .net framework namespace system.

///p/invoke (platform invoke)
namespace pinvoke
    public static class user32
        // public const intptr hwnd_broadcast = new intptr(0xffff);
        public const uint32 wm_settingchange = 0x001a;

        // sendmessagetimeout(hwnd_broadcast, wm_settingchange, 0,    (lparam) "environment", smto_abortifhung,    5000, &dwreturnvalue);

        /// if the function succeeds, the return value is nonzero. 
        [system.runtime.interopservices.dllimport("user32.dll", entrypoint = "sendmessagetimeout", setlasterror = true)]
        public static extern uint sendmessagetimeout(intptr hwnd, uint msg, int wparam, string lparam, sendmessagetimeoutflags fuflags, uint utimeout, out int lpdwresult);

    public enum sendmessagetimeoutflags : uint
        smto_normal = 0x0,
        smto_block = 0x1,
        smto_abortifhung = 0x2,
        smto_notimeoutifnothung = 0x8,
        smto_erroronexit = 0x20

    public class program
        public static void main(string[] args)
            //int innerpinvokeresult;
            //uint pinvokeresult = user32.sendmessagetimeout(user32.hwnd_broadcast, user32.wm_settingchange, 0, "environment", sendmessagetimeoutflags.smto_normal, 1000, out innerpinvokeresult);

    add-type -typedefinition $sig

## [pinvoke.program]::main([intptr]::zero);

[pinvoke.user32]::sendmessagetimeout([intptr]0xffff, [pinvoke.user32]::wm_settingchange, 0, "environment", [pinvoke.sendmessagetimeoutflags]::smto_normal, 1000, [ref]$innerpinvokeresult);

setx setx [/s [/u [] [/p []]]] [/m]

/m specifies to set the variable in the system environment. the default setting is the local environment


when i had such problem, in my case i had x64 jdk + jre installed with x86 eclipse. so installing of x86 jdk + jre solved my problem :) also i created jre folder in eclipse folder and copied bin folder from my local path c:\program files (x86)\java\jre7 to ..\eclipse\jre\.


  • 64-bit os--> you need: 64-bit java and 64-bit eclipse
  • 32-bit os--> you need: 32-bit java and 32-bit eclipse

if you update your java version with default update in your 64 bit computer (and you have 32 bit browser), java will install 32 bit version. you should find 64 bit java version and install it.


make a batch file in the eclipse folder and write in it :

eclipse -vm c:\sun\sdk\jdk\jre\bin\javaw.exe



if after adding the c:\program files\java\jdk1.8.0_92\bin in path variable in environment variables the eclipse gave the same error

check eclipse configuration settings file that found in eclipse folder, you must see the same jdk path you have in c:\program files

enter image description here

i hope it help.


edited my eclipse.ini file to update the newly updated jdk. previously i had jdk1.7.0_09 and updated now to jdk1.7.0_80 and eclipse threw this error.

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:/program files/java/jdk1.7.0_09/bin/javaw

after updating eclipse.ini from,

c:/program files/java/jdk1.7.0_09/bin/javaw


c:/program files/java/jdk1.7.0_80/bin/javaw

eclipse works fine.


in your eclipse.ini file, you need to update the path to the vm to point to the same location where javaw.exe is installed on your machine.


don't worry i was also ruined by this error and fatal and when i got it i was so frustrate even i was giving to leave an android programming, 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 in a nutshell:

right-click on my computer, click properties, then advanced system settings, a system properties window will popup, under advanced tab, choose environment variables, environment variables window will popup, under the system variables section , look for path variable, and edit the value, changing it (the version; jre6,jre7, etc) to whatever jre you're using, e.g for mine: c:\program files\java\jre7\bin


do not rely on the windows path variable because it gets changed in nearly every update. e.g. a chrome (32bit on a 64 bit machine) java update replaces the systemwide 64 bit jvm by a 32 bit jvm. note also that this entry has to be the last one in the eclipse.ini, otherwise it does not work,and - as otherwise stated - the java_home variable is not evaluated by eclipse.exe.

even if your has java_home and path configured valid,their may has this problem,so the most simple way to do is open your eclipse.ini in your eclipse installtion folder


c:\program files\java\jdk1.7.0_71\bin\javaw.exe

replace c:\program files\java\jdk1.7.0_71\bin\javaw.exe with your jdk or jre `s path


i have windows 7 64-bit, and i had this same problem with eclipse. to get it to work, i had to use internet explorer (64-bit version) to download java. this was the only way to get java to install a 64-bit version. when i used firefox to install java, it automatically installed a 32-bit version (so idiotic!). and the eclipse 64-bit version wouldn't detect the java 32-bit version.


it turned out that all i needed to do was change the 'path' to:

"c:\windows\system32;c:\windows;c:\windows\system32\wbem; c:\program files (x86)\java; c:\program files (x86)\java\jdk1.6.0_14\bin"

that did it :)


if you download the 64 bit version of eclipse; it will look for the 64 bit version of jre. if you download the 32 bit version of eclipse; it will look for the 32 bit version of jre

what i did was to install the both the 32 and 64 bit version of jre. you can get that from the sun oracle site. the java site seems to automatically install the 32 bit version of java. i guess that's because of the web browser.


open up windows' system properties from the control panel and hunt down the environment variables section:

  • add a java_home entry pointing to the directory where the jdk is installed (e.g. c:\program files\java\jre6)
  • find the path entry and add the following onto the end ;%java_home%\bin
  • ok the changes
  • restart eclipse so that it is aware of the new environment

most java tools will now be able to find your java installation either by using the java_home environment variable or by looking for java.exe / javaw.exe in the path environment variable.


all the other answers about setting only the java_home are not entirely right. eclipse does namely not consult the java_home. look closer at the error message: your current path

it literally said path, not java_home.

rightclick my computer and choose properties (or press winkey+pause), go to the tab advanced, click the button environment variables, in the system variables list at the bottom select path (no, not classpath), click edit and add ;c:\path\to\jdk\bin to the end of the value.

alternatively and if not present, you can also add java_home environment variable and make use of it in the path. in the same dialogue click new and add java_home with the value of c:\path\to\jdk. then you can add ;%java_home%\bin to end of the value of the path setting.


just copy this file :

c:/program files/java/jre(5,6,7..any version)/bin/javaw.exe

to eclipse folder

*note only tested for windows

replacing javaw.exe in eclipse folder

Related Query

More Query from same tag