Eclipse - no Java (JRE) / (JDK) … no virtual machine

前端 未结 30 1496
青春惊慌失措
青春惊慌失措 2020-11-22 05:58

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:

相关标签:
30条回答
  • 2020-11-22 06:16

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

    0 讨论(0)
  • 2020-11-22 06:19

    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.

    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.

    0 讨论(0)
  • 2020-11-22 06:20

    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,

    -vm
    C:/Program Files/Java/jdk1.7.0_09/bin/javaw
    

    to

    -vm
    C:/Program Files/Java/jdk1.7.0_80/bin/javaw
    

    Eclipse works fine.

    0 讨论(0)
  • 2020-11-22 06:21

    Try setting your JAVA_HOME to the correct folder. Google for setting environment variables in Windows.

    0 讨论(0)
  • 2020-11-22 06:22

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

    0 讨论(0)
  • 2020-11-22 06:22

    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..
    0 讨论(0)
提交回复
热议问题