Ben E.
Ben E.

Reputation: 10632

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

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.

After first trying to start Eclipse without any parameters to specify the Java VM, I got an error message saying it couldn't find a Java VM called javaw.exe inside the Eclipse folder, so I found where Java was installed and specified that location as the parameter in the shortcut's target. Now I get a different error, Java was started but returned exit code=13.

Similar questions seem to indicate that it's a 32-bit/64-bit conflict, but I'm 99% positive that I downloaded 64-bit versions of both Eclipse and Java (RE 7u5), which I chose because I have 64-bit Windows 7.

Shortcut Target: "C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\eclipse.exe" -vm "C:\Program Files (x86)\Java\jre7\bin\javaw.exe"

Full error code...:

Java was started but returned exit code=13
C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
-os win32
-ws win32
-arch x86_64
-showsplash C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins\org.eclipse.platform_4.2.0.v201206081400\splash.bmp
-launcher C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\eclipse.exe
-name Eclipse
--launcher.library C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v201205221813\eclipse_1503.dll
-startup C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 1e30_5c
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar

Upvotes: 1045

Views: 1732751

Answers (30)

TastyCode
TastyCode

Reputation: 5799

Adding vm argument to .ini file worked for me

-vm
C:\Program Files\Java\jdk1.7.0_65\bin\javaw.exe

Adding more details to this

for sts 3.9.18 release I was getting error Java was started but returned exit code=13 and for latest release same issue just the returned exit code was 14. This was due to default java chosed was of 32 bit and this version of sts/eclipes is for 64 bits. resolved this by setting 64 bits version of java in STS.ini file as -vm C:\Progra~1\Java\jdk1.8.0_131\bin\javaw.exe This is before vmargs parameters in the file.

Upvotes: 26

Gaurav
Gaurav

Reputation: 657

it could be JDK combinations issue or JDK version issue select proper one. i am using combination of 64-bit Operating System, 64-bit JDK, 64-bit Eclipse IDE.

Upvotes: 0

tk_
tk_

Reputation: 17418

There are working combinations of OS, JDK and Eclipse bitness. In my case, I was using a 64-bit JDK with a 32-bit Eclipse on a 64-bit OS. After downgrading the JDK to 32-bit, Eclipse started working.

Use one of the following combinations.

  • 32-bit OS, 32-bit JDK, 32-bit Eclipse (32-bit only)
  • 64-bit OS, 32-bit JDK, 32-bit Eclipse
  • 64-bit OS, 64-bit JDK, 64-bit Eclipse (64-bit only)

Upvotes: 227

Varun Saxena
Varun Saxena

Reputation: 61

In "Path" variable removed "C:\ProgramData\Oracle\Java\javapath" and replaced it with "C:\Program Files\Java\jdk1.8.0_212\bin"

It worked for me.

Upvotes: 4

DNA
DNA

Reputation: 42617

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.

Upvotes: 769

Sankar
Sankar

Reputation: 709

In my case, I have two different JDK that is IBM and Oracle JDK. I moved IBM JDK to the top of the Oracle JDK in environment variable then it worked. Note: I am going to use IBM JDK so I moved up.

Upvotes: 0

minigeek
minigeek

Reputation: 3166

In case your machine has multiple Java versions installed, you can simply tell eclipse which and from where to use javaw.exe.

In my case I have IBM JDK, with oracle JDK too, but for eclipse to pickup, Added below lines in eclipse.ini file in eclipse directory and it worked.

-vm
C:/WAS9DEV/java/8.0/bin/javaw.exe

Path to your java folder has to be replaced in above example

Hope it helps.

Upvotes: 2

Saurabh Prakash
Saurabh Prakash

Reputation: 2925

You have to go to the folder where eclipse is installed and then you have to change the eclipse.ini file.

You have to add

-vm

C:\Program Files\Java\jdk1.8.0_202\bin\javaw.exe

Your eclipse.ini file will look like the below screenshot

enter image description here

Upvotes: 11

user6743474
user6743474

Reputation:

At the risk of not adding a great deal of value to the existing answers, but having gone through all this mess myself, I would like to see if I can consolidate how I addressed the problem:

  1. Maintain separate Development from your normal machine environments. The reason for this is that there are probably many applications running on your machine that you are not aware of that need Java to be updated occasionally, for example banking and security applications. When those updates occur they change the environmental variables and so if you are using those in your development environment the update will almost certainly break your Eclipse setup.

  2. Install versions of Eclipse, either 32 and 64 bit depending on your plugins etc. The reason is that many plugins still require 32bit and trying to install them into a 64bit environment causes many obscure (very obscure) errors. This means for example you may have to have separate instances of Eclipse for your Java EE, PHP, Python, Assembler, etc, development environments. This may appear to be onerous, but for me this has been a blessing.

  3. Install two Java runtimes once again one 32bit and one 64bit and then edit the eclipse.ini for each of your installations to point to the correct JRE, not the JRE HOME in the environmental variables. I create a directory in C:\Java\64bit\jdk1.7.0_15\ and C:\Java\32bit\etc and in your eclipse.ini file you add the -vm C:\Java\64bit\jdk1.7.0_15\bin line to point to your needed java runtime.

Once the above is done you can install Java SDKs updates as much as you like but your development environment will never break. If you need to update your development runtime environment just alter the -vm path in your eclipse.ini

Upvotes: 2

mortensi
mortensi

Reputation: 2917

I got this error and found that my PATH variable (on Windows) was probably changed. First in my PATH was this entry:

C:\ProgramData\Oracle\Java\javapath

...and Eclipse ran "C:\ProgramData\Oracle\Java\javapath\javaw" - which gave the error. I suspect that this is something that came along with an installation of Java 8.

I have several Java versions installed (6,7 and 8), so I removed that entry from the PATH and tried to restart Eclipse again, which worked fine.

If it's doesn't work for you, you'll need to upgrade your JDK (to the Java versions - 8 in this case).

Instructions on how to edit PATH variable

Upvotes: 258

Ahmad Ismail
Ahmad Ismail

Reputation: 13942

The solution is simple: Put the "eclipse" folder on "C:/Program Files". If it does not work, put it in "C:/Program Files (x86)".

Upvotes: 10

vishal129
vishal129

Reputation: 105

It could be due to too little memory. You can modify the eclipse.ini file to increase the memory. Something like this might help you: FAQ How do I increase the heap size available to Eclipse?

Upvotes: 4

HoosierDude
HoosierDude

Reputation: 191

I had the same issue... installed STS but consistently got the "java was started but returned exit code=13" message. My issue was that I was using the default install file, which was not processor specific, from https://spring.io/tools/sts. I had to dive deeper to be very specific in downloading the 64 bit version. It was not intuitive as to which version you were downloading. Once I got the 64 bit version (note that the zip file still includes 'win32' in the name, just appends '-64' at end) it worked.

Upvotes: -1

Siddarth Kanted
Siddarth Kanted

Reputation: 5914

  1. Under system environment variables, make sure "C:\ProgramData\Oracle\Java\javapath" is removed.

  2. Under system environment variables, make sure "C:\Program Files\Java\jdk1.8.0_131\bin" is added.

enter image description here

Upvotes: 6

Pythoner
Pythoner

Reputation: 5595

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

Upvotes: 13

dush88c
dush88c

Reputation: 2116

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.

Upvotes: 4

The HCD
The HCD

Reputation: 510

The top answer didn't work for me: I had no environment variables defining the Java path or no Java in my path.

However, the path C:\ProgramData\Oracle\Java\javapath\javaw.exe was always present in the Eclipse 4.5 (Mars) error popup in the -vm option even if I tried to override in file eclipse.ini.

I worked around this by opening a command prompt, cd'ing the directory where the eclipse.exe was and using MKLink:

C:\EclipseMars> mklink javaw.exe "C:\Program Files\Java\jdk1.7.0_79\bin"
symbolic link created for javaw.exe <<===>> C:\Program Files\Java\jdk1.7.0_79\bin

No changes to eclipse.ini were required.

I did try to specify the -vm option of in eclipse.ini, and it was taken into account, but in the error popup a -vm option was present twice even if only one -vm was present in eclipse.ini.

In my eclipse.ini I have no -vm option and just the symlink seems to have corrected it.

Upvotes: 1

James Wierzba
James Wierzba

Reputation: 17568

I've solved this issue by installing a JDK (v7 update 80) whereas I had only had the JRE installed before.

Note: This was for IBM's RTC software (built on Eclipse).

Upvotes: 1

Bhanupratap Singh
Bhanupratap Singh

Reputation: 111

This type of errors occur basically due to use of different versions of Java with different version of Eclipse.

Suppose you are installing the 64-bit JDK on your system. Then make sure you install the 64-bit versioned Eclipse with it.

And if you are installing the 32-bit JDK on your system then make sure you install 32-bit versioned Eclipse with it.

I had the similar problem. I have installed the 32-bit JDK and was trying to use 64-bit Eclipse.

But when I installed the 64-bit JDK on my system then Eclipse started working without any problem.

It is advised to better install the 32-bit version of Java along with the 32-bit version Eclipse on a system with a 32-bit configuration and similarly for 64-bit systems.

This helps to increase performance of the system.

Upvotes: 3

hamish
hamish

Reputation: 1182

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\

Upvotes: 10

Touchstone
Touchstone

Reputation: 5982

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

Upvotes: 5

Benjamin
Benjamin

Reputation: 2123

A clean reinstall of the Java JDK did the trick in my case. I am running Eclipse 4.4 (Luna) like a charm now.

Upvotes: 11

fresko
fresko

Reputation: 2062

The best answer here is too long. I cannot comment so I added my answer.

  1. Go here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Download the latest SDK (of course for x64 if your computer is x64)
  3. Install it
  4. Now the party is finished, and it's time to work with Eclipse ;)

Upvotes: 9

Peter Huang
Peter Huang

Reputation: 1198

I had the same issue after I upgraded my JDK from 1.7 to 1.8. I'm using Eclipse 4.4 (Luna). The error is gone after I degrade JDK to 1.7.

Upvotes: 4

IrfanClemson
IrfanClemson

Reputation: 1779

I had a similar error after installing Java 8 on my Windows 7 system, 64 bit system.

Changing environment variables, etc. did not help. So I tried to remove the Java Update 8, but that too did not help. Downloading and installing the 64-bit version of Java 8 SDK fixed my problem. I hope this helps.

Upvotes: 4

kapil thadani
kapil thadani

Reputation: 1425

If nothing works, then the last solution you can try is to completely uninstall Java from your computer and then install it again, and make sure the path variables are set correctly.

Upvotes: 2

Jitendra
Jitendra

Reputation: 1125

I tried the following solution:

I created a shortcut of javaw.exe from path C:\Program Files\Java\jdk1.7.0_71\bin and pasted it into the path C:\ProgramData\Oracle\Java\javapath.

After that, I launched Eclipse, and it worked for me.

Upvotes: 5

Sabri Mevis
Sabri Mevis

Reputation: 2431

I had an x64 bit JDK. There was nothing in my path settings. So I installed the x86 JDK. This solved my problem perfectly.

Upvotes: 2

dreamdeveloper
dreamdeveloper

Reputation: 1276

enter image description here

The issue was fixed by doing the following steps.

  1. Eclipse finds the JAVA executables from 'C:\ProgramData\Oracle\Java\javapath'

  2. The folder structure will contain shortcuts to the below executables,
    i. java.exe
    ii. javaw.exe
    iii. javaws.exe

  3. For me the executable paths were pointing to my Program Files(x86) (home for 32 bit applications) folder location

  4. I corrected it to Program Files (which homes 64-bit applications) and the issue got resolved

Please find the screenshot for the same.

Upvotes: 26

Kandy
Kandy

Reputation: 1107

I tried some of the solutions, but not worked for me.

Finally, I found another way, ...

Go to Environment VariablesSystem Variables

Set C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe to the path in the system variables.

Try it. It worked for me...

Upvotes: 5

Related Questions