Question

How to Fix Eclipse Exit Code 13: 32-bit vs 64-bit Java on Windows

javaandroidwindowseclipse32bit-64bit

Question

I am trying to start Eclipse for Android development on Windows 7, but Eclipse will not launch.

At first, I started Eclipse without specifying a Java VM, and Eclipse reported that it could not find javaw.exe inside the Eclipse folder. I then found my Java installation and added it to the shortcut target manually.

Now Eclipse starts with a different error:

Java was started but returned exit code=13

Here is the shortcut target I am using:

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

Here is the full error output:

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

I have read that this may be caused by a 32-bit versus 64-bit mismatch. I believe I downloaded 64-bit versions of both Eclipse and Java because I am using 64-bit Windows 7.

How can I confirm whether Eclipse and Java are actually both 64-bit, and how can I fix this error if the problem is something else?

Short Answer

By the end of this page, you will understand what Eclipse exit code 13 usually means, how 32-bit and 64-bit Java must match Eclipse, how to verify your Java installation on Windows, and how to configure the correct javaw.exe path so Eclipse can start successfully.

Concept

Eclipse is a Java-based application, so it needs a compatible Java Runtime Environment (JRE) or Java Development Kit (JDK) to launch.

The key idea behind this error is architecture compatibility:

  • A 64-bit Eclipse must run with a 64-bit Java.
  • A 32-bit Eclipse must run with a 32-bit Java.
  • If they do not match, Eclipse often fails with exit code 13.

In the question, Eclipse is installed in this folder:

C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\

The x86_64 part strongly suggests that Eclipse is 64-bit.

But the Java path being used is:

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

On Windows, Program Files (x86) is typically where 32-bit applications are installed. That strongly suggests the selected Java is 32-bit.

That mismatch is the most likely cause of the error.

Why this matters in real programming:

  • IDEs like Eclipse, IntelliJ IDEA, and older Android tooling depend on the local Java installation.
  • Build tools, servers, and command-line utilities often fail when the wrong Java version or architecture is used.
  • Understanding how to verify runtime paths and system architecture is an essential debugging skill.

So this is not only an Eclipse problem. It is a general lesson in how programs depend on the correct runtime environment.

Mental Model

Think of Eclipse and Java like a plug and a socket.

  • A 64-bit Eclipse is a plug shaped for a 64-bit socket.
  • A 32-bit Java is a different socket shape.
  • Even though both are "Java-related," they do not fit together.

Another way to think about it:

  • Eclipse is the car.
  • Java is the fuel type it requires.
  • If the car needs diesel and you give it petrol, the engine will not start.

Exit code 13 is Eclipse's way of saying, "I found Java, but I cannot run correctly with this one."

Take Quiz

Syntax and Examples

When Eclipse needs a specific Java installation, you can point to it with the -vm option.

Core syntax:

eclipse.exe -vm "C:\path\to\javaw.exe"

A more reliable approach is to place the Java path in eclipse.ini instead of editing the shortcut.

Example:

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

Important rules:

  • -vm must be on its own line in eclipse.ini
  • The Java path must be on the next line
  • Use javaw.exe, not java.exe
  • The Java architecture must match the Eclipse architecture

Example: incorrect setup

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

This is likely wrong because:

  • x86_64 indicates 64-bit Eclipse
  • Program Files (x86) usually indicates 32-bit Java

Example: correct setup

Eclipse: C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\
Java:    C:\Program Files\Java\jre7\bin\javaw.exe

or

Eclipse: C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\
Java:    C:\Program Files\Java\jdk1.7.0_xx\bin\javaw.exe

How to check Java from the command line

java -version

Possible output:

java version "1.7.0_05"
Java(TM) SE Runtime Environment
Java HotSpot(TM) 64-Bit Server VM

If you see 64-Bit Server VM, Java is 64-bit.

If you do not see 64-Bit, it is often 32-bit.

Step by Step Execution

Consider this situation:

Eclipse folder: C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\
Java path:      C:\Program Files (x86)\Java\jre7\bin\javaw.exe

Here is what happens step by step:

  1. You start eclipse.exe.
  2. Eclipse looks for a Java runtime.
  3. Because -vm was provided, Eclipse uses:
    C:\Program Files (x86)\Java\jre7\bin\javaw.exe
    
  4. Eclipse begins launching with Java.
  5. Eclipse's launcher detects its own architecture:
    -arch x86_64
    
  6. The selected Java is likely 32-bit because it is under Program Files (x86).
  7. Eclipse and Java do not match.
  8. Launch fails, and Eclipse reports:
    Java was started but returned exit code=13
    

Fixed version

If you change the Java path to a 64-bit installation, for example:

C:\Program Files\Java\jre7\bin\javaw.exe

then the sequence becomes:

  1. Eclipse starts.
  2. Eclipse uses the 64-bit javaw.exe.
  3. Java architecture matches Eclipse architecture.
  4. The launcher can continue normally.
  5. Eclipse opens successfully.

Quick debugging checklist

1. Is Eclipse 32-bit or 64-bit?
2. Is Java 32-bit or 64-bit?
3. Does the `-vm` path point to the correct javaw.exe?
4. Is the path written correctly?
5. Are you editing the shortcut or eclipse.ini consistently?

Real World Use Cases

This concept appears in many real development tasks.

IDE setup

  • Eclipse, IntelliJ, NetBeans, and Android Studio all depend on a compatible Java runtime.
  • A wrong architecture or wrong path can prevent the IDE from launching.

Build tools

  • Maven and Gradle use Java under the hood.
  • If JAVA_HOME points to the wrong installation, builds may fail or use the wrong version.

Application servers

  • Tomcat, Jetty, and older enterprise servers may fail to start if the configured JVM is missing or incompatible.

Native integration

  • Tools that load platform-specific libraries often require architecture alignment.
  • A 64-bit app cannot load a 32-bit native library, and vice versa.

CI and deployment machines

  • On a build server, a deployment script might break because Java 8 is expected but Java 17 is installed, or because the wrong architecture is used.

The main lesson is that many tools rely on an external runtime, and when startup fails, checking the runtime path and version is one of the first things developers do.

Take Quiz

Real Codebase Usage

In real projects, developers usually avoid hard-to-debug startup issues by using a few common patterns.

Explicit configuration

Instead of relying on whatever Java happens to be first on the machine, teams often configure the exact runtime path.

Examples:

  • eclipse.ini for Eclipse
  • JAVA_HOME for build tools
  • tool-specific config files for local development

Environment validation

A setup script may check:

  • Java is installed
  • the version is acceptable
  • the architecture matches requirements

Example idea in a batch script:

java -version
if errorlevel 1 echo Java is not installed correctly.

Guard clauses

Developers often fail early when the environment is wrong.

For example:

  • stop startup if Java is missing
  • print a clear message if the version is unsupported
  • refuse to run with a mismatched architecture

Consistent tooling

In teams, it is common to standardize on:

  • one JDK version
  • one architecture
  • one install path convention

This reduces "works on my machine" problems.

Prefer JDK for development

For development tools, many teams use a JDK rather than only a JRE because:

  • it includes development tools
  • it is the standard setup for compiling and debugging Java applications
  • some tools expect it

For old Eclipse and Android setups especially, installing a full JDK is often safer than relying on a JRE alone.

Common Mistakes

1. Assuming 64-bit Windows means Java is automatically 64-bit

This is a very common mistake.

You can have:

  • 64-bit Windows
  • 64-bit Eclipse
  • but still a 32-bit Java installation

In the question, the Java path is:

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

That strongly suggests 32-bit Java.

2. Using the wrong folder as proof

Beginners often judge only by the download they think they selected.

Instead, verify the actual installed Java by running:

java -version

Look for:

64-Bit Server VM

3. Editing only the shortcut when Eclipse also reads eclipse.ini

Sometimes startup options are duplicated or overridden.

A cleaner setup is often to edit eclipse.ini.

Broken idea:

"eclipse.exe" -vm "some\path\javaw.exe"

This can work, but it is easier to manage in eclipse.ini.

4. Using java.exe instead of javaw.exe

For Eclipse on Windows, javaw.exe is typically used.

  • java.exe opens a console window
  • javaw.exe is intended for GUI apps

5. Putting -vm on one line incorrectly in eclipse.ini

Broken example:

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

Safer format:

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

6. Installing only a JRE when a JDK is more appropriate

For Java development, a JDK is usually the better choice.

Use a path like:

C:\Program Files\Java\jdk...\bin\javaw.exe

7. Ignoring the clues in the error output

The error output already tells you important facts:

  • -arch x86_64 means Eclipse is 64-bit
  • Java path under Program Files (x86) points to likely 32-bit Java

Reading error messages carefully is a key debugging skill.

Comparisons

Item32-bit64-bit
Typical Windows install folderC:\Program Files (x86)C:\Program Files
Eclipse label examplewin32 or x86x86_64
Java version outputusually no 64-Bit textincludes 64-Bit Server VM
Compatibilitymust match 32-bit Eclipsemust match 64-bit Eclipse
OptionWhen to use itNotes
Set Java in shortcutQuick testingCan be harder to maintain
Set Java in eclipse.iniPreferred for consistencyClear and repeatable
Use JRERunning Java appsSometimes enough
Use JDKDevelopmentUsually best for Eclipse and Android work
SymptomLikely cause
javaw.exe not foundEclipse cannot locate Java
Exit code 13Architecture mismatch or invalid JVM setup
Eclipse opens but build tools failWrong Java version or incomplete JRE/JDK setup
Take Quiz

Cheat Sheet

Quick diagnosis

  • exit code=13 often means Eclipse and Java do not match
  • 64-bit Eclipse needs 64-bit Java
  • 32-bit Eclipse needs 32-bit Java

Strong clues on Windows

  • C:\Program Files usually means 64-bit
  • C:\Program Files (x86) usually means 32-bit
  • x86_64 in the Eclipse folder usually means 64-bit Eclipse

Check Java version

java -version

Look for:

64-Bit Server VM

Recommended Eclipse config

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

Good rules

  • Use javaw.exe
  • Put -vm before -vmargs in eclipse.ini
  • Keep Java and Eclipse architectures the same
  • Prefer a JDK for development

Likely fix for this specific case

Change from:

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

To a 64-bit Java path such as:

C:\Program Files\Java\jre7\bin\javaw.exe

or install a 64-bit JDK and use:

C:\Program Files\Java\jdk...\bin\javaw.exe

FAQ

Why does Eclipse say "Java was started but returned exit code=13"?

Most often, Eclipse found Java but could not use it because the Java architecture does not match Eclipse, or the configured JVM path is wrong.

How do I know whether my Java is 32-bit or 64-bit?

Run:

java -version

If the output contains 64-Bit Server VM, it is 64-bit.

How do I know whether my Eclipse is 32-bit or 64-bit?

Check the download name or installation folder. A name like x86_64 indicates 64-bit Eclipse.

Is Program Files (x86) always 32-bit?

On 64-bit Windows, that folder is normally used for 32-bit applications, so it is a strong clue that the installed Java is 32-bit.

Should I use a JRE or a JDK with Eclipse?

For development, a JDK is usually better because it includes development tools and is the standard choice for Java IDEs.

Should I configure Java in the shortcut or in eclipse.ini?

eclipse.ini is usually the cleaner and more reliable option.

Can I have both 32-bit and 64-bit Java installed?

Yes. That is why checking the exact path matters. Eclipse may use a different Java installation than the one you expect.

Take Quiz

Mini Project

Description

Create a small Windows troubleshooting checklist for launching Eclipse with the correct Java runtime. This project demonstrates how to inspect paths, identify 32-bit versus 64-bit installations, and configure Eclipse to use the intended javaw.exe.

This is useful because many development tools fail for environment reasons rather than code errors. Learning to verify the runtime is a practical debugging skill.

Goal

Build a repeatable process that verifies Java architecture and configures Eclipse to launch with the correct JVM.

Requirements

  1. Identify whether the Eclipse installation is 32-bit or 64-bit.
  2. Check the installed Java version and architecture from the command line.
  3. Find the correct javaw.exe path on disk.
  4. Configure Eclipse to use that Java path.
  5. Verify that Eclipse launches without exit code 13.
Take Quiz

Keep learning

Related questions

View more