Can't start Eclipse - Java was started but returned exit code=13

前端 未结 30 1442
野的像风
野的像风 2020-11-22 00:49

I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.

相关标签:
30条回答
  • 2020-11-22 01:31

    Locate eclipse.ini:

    Often at C:\Users\xxx\eclipse\jee-neon\eclipse, add

    -vm
     C:\Program Files (x86)\Java\jre7\bin\javaw.exe
    

    after

    --launcher.appendVmargs
    
    0 讨论(0)
  • 2020-11-22 01:31

    Please check whether you have set two JAVA paths in the Environment Variable section. If you already installed two versions of the JDK, it might be, then double check you have put PATH for Java like below.

    PATH -->  C:\ProgramData\Oracle\Java\javapath
    

    and also

    JAVA_HOME ---> C:\Program Files\Java\jdk1.7.0_02\bin
    

    If both are there, then this sort of error may occur.

    If it's OK, then check in the ".ini" file the below area is OK or not. Open ".ini" file and check

     -VM  path is  C:\Program Files\Java\jdk1.7.0_79\bin\
    

    If not, please set it like that and run again.

    0 讨论(0)
  • 2020-11-22 01:32

    It turned out I only had the 32-bit Java runtime installed.

    C:\Program Files (x86)\Java\jre1.8.0_45\
    

    All Eclipse really wanted was for me to install the 64-bit Java runtime. <= SOLVED

    Java SE Runtime Environment 8u45  jdk-8u45-windows-x64.exe
    

    http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

    Confirm your installation by checking you now have this folder
    
        C:\Program Files\Java\jre1.8.0_45\
    
    0 讨论(0)
  • 2020-11-22 01:33

    Your version of Eclipse is 64-bit, based on the paths and filenames. However, the version of Java that it's picking up is 32-bit, as indicated by where it is coming from, on this line:

    -vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
    

    Program Files (x86) is the folder where 64-bit Windows places 32-bit programs.

    Program Files is the folder where 64-bit Windows places 64-bit programs.

    This can happen when a system has more than one JVM installed, as is often the case on Windows 64-bit (for example, the JRE download page uses the bit-ness of the browser to determine what bit-ness download to offer you, and many people use(d) 32-bit browsers even though they run 64-bit Windows).

    The best way to fix this, assuming you do in fact have 64-bit JRE or JDK on your system, is to specify in eclipse.ini exactly which JVM you want it to use. The instructions are detailed in the Eclipse wiki page, but basically you have to specify the -vm option in the ini file - make sure to read the wiki page carefully as the format is very specific.

    Specifying the JVM path in eclipse.ini is strongly recommended because doing so isolates Eclipse from any potential changes to your system PATH that some program installers might make (I'm talking to you, Oracle!).

    Another option would be to download and use 32-bit Eclipse instead of 64-bit, but it's still strongly recommended to specify the path to the JVM in eclipse.ini.


    Left for historical reference:

    To check your version of Java, run

      java -version 
    

    in a console (command prompt). On Windows 7 with 64-bit Java 6 I get:

      java version "1.6.0_27"
      Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
    

    Note the 3rd line, which shows that this is a 64-bit version.

    On a 32-bit version you'll get something like:

      Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) 
    

    If you are on a 64-bit machine, then you can install the 64-bit JDK and uninstall the 32-bit one. For instance on Windows 10, just go to Settings and under Apps, you will find Java. Click on it and you will find all the different versions. Now you can select which one to uninstall.

    0 讨论(0)
  • 2020-11-22 01:33

    I also encountered the same issue. It turned out that the environment variable Path was pointing to an incorrect Java version.

    Please check the environment variable and point it to the correct Java. For example:

    C:\Program Files (x86)\Java\jdk1.6.0_17\bin
    

    To check the environment variable, go to:

    Computer → properties → Advanced system settings → Advanced -> Environment variables
    
    0 讨论(0)
  • 2020-11-22 01:34

    I had the same issue, Java was started but returned exit code=13.

    My solution was to create an environment variable to Windows properties variable name = PATH variable value = C:\Program Files\Java\jdk1.7.0_02\bin, not to C:\Program Files (x86)\Java\jre7\bin.

    Next I added a line to file eclipse.ini → C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe.

    That worked for me.

    0 讨论(0)
提交回复
热议问题