no Java (JRE) / (JDK) ... no virtual machine

I am trying to get Eclipse v3.5 (Galileo) to re-run on my computer - I have run it before with no problems, but now I keep getting 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:eclipsejrejavaw.exe javaw.exe in your current PATH

I've just done a fresh install of both the JDK and the SDK.

I have Windows 7 (x64).

What's up with this? How do I fix it?

I can't run any of the ipconfig / tracert / or ping.


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:
  • Reference that exact JRE path in your eclipse.ini.
  • Copy any JRE of your in your <eclipse>/jre directory. In both cases, no PATH to update.
  • 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.
  • 安装了JRE


    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 copy this file :

    c:/Program Files/Java/jre(5,6,7..any version)/bin/javaw.exe
    

    to Eclipse Folder

    *note only tested for Windows

    替换Eclipse文件夹中的javaw.exe


    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:

    ...in 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:pathtojdkbin 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:pathtojdk . Then you can add ;%JAVA_HOME%bin to end of the value of the Path setting.

    链接地址: http://www.djcxy.com/p/16156.html

    上一篇: Android SDK安装没有找到JDK

    下一篇: 没有Java(JRE)/(JDK)...没有虚拟机