Eclipse Problems
Java Errors
Exit Code 13
Programming Troubleshooting
Software Issues

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

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

When attempting to start the Eclipse Integrated Development Environment (IDE), encountering the error "Java was started but returned exit code=13" can be frustrating. This error typically arises due to a compatibility issue between the installed Java version and the architecture (32-bit or 64-bit) of your Eclipse IDE. Understanding and resolving this issue involves examining a few key system and software characteristics.

Understanding the Error

The exit code=13 error pops up mainly because of a mismatch between the versions and architectures of Eclipse and the Java Runtime Environment (JRE) or Java Development Kit (JDK) installed on your machine. Eclipse relies on the Java platform for running; hence, the harmonization between your system’s processor architecture and the Java version is critical for Eclipse’s operation.

Common Causes

  1. Architecture Mismatch: If you installed a 64-bit version of Eclipse and a 32-bit version of JRE/JDK, or vice versa.
  2. Incorrect Java Path Configuration: Eclipse might be pointing to an incorrect version of Java that is not compatible with its architecture.
  3. Outdated Software: Running older versions of either Java or Eclipse that do not support an available update might cause inconsistencies.

Step-by-Step Troubleshooting

  1. Check Eclipse and Java Versions: Confirm whether you are running 32-bit or 64-bit versions of both Java and Eclipse.
    • To check Java's version, open a command prompt or terminal and type:
bash
      java -version
  • For Eclipse, usually, 32-bit versions are labeled x86, and 64-bit versions are labeled x64 in their respective installation paths or file names.
  1. Update Java or Eclipse: Ensure both Java and Eclipse are updated to their latest releases from their official websites.
  2. Configure Eclipse to Use the Correct Java Path:
    • Edit the ‘eclipse.ini’ file, which is found in the Eclipse installation directory.
    • Make sure that the -vm option in eclipse.ini is pointing to the correct javaw.exe path. The configuration should look like:
 
     -vm
     C:/path-to-java-version/bin/javaw.exe

Ensure there's a line break between -vm and the path.

  1. Environment Variables: Adjust your system’s environment variables so that PATH includes the correct path to the needed Java version.

Example: Correcting the Path in eclipse.ini

Here's an example of adjusting the eclipse.ini to ensure it points to a JDK 11 installed on a Windows 64-bit machine:

 
1-startup
2plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
3--launcher.library
4plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
5-product
6org.eclipse.epp.package.common.product
7--launcher.defaultAction
8openFile
9-showsplash
10org.eclipse.platform
11--launcher.XXMaxPermSize
12256m
13-vm
14C:/Program Files/Java/jdk-11/bin/javaw.exe
15--launcher.appendVmargs
16-vmargs
17-Dosgi.requiredJavaVersion=11
18-Xms256m
19-Xmx1024m

Verifying the System Architecture

Run the following command in Command Prompt (Windows) or Terminal (Mac/Linux) to check if your CPU can run 64-bit applications:

  • Windows: wmic os get osarchitecture
  • Mac/Linux: uname -m

If these outputs match with the version of Eclipse and Java installed (both should be either 64-bit or 32-bit), the setup should work without the error.

Summary Table

Key PointDetail
Error CodeExit code=13
Primary CauseMismatch in architecture between Eclipse and Java
Resolution StepsValidate versions, update software, adjust paths
File to Modifyeclipse.ini
Commands to Checkjava -version, wmic os get osarchitecture, uname -m

Additional Tips

  • When downloading a JDK or JRE, always verify its compatibility with your version of Eclipse.
  • Regularly update both Java and Eclipse to minimize compatibility issues and benefit from the latest features and security enhancements.
  • Always make a backup of configuration files like eclipse.ini before making changes.

In summary, the exit code=13 error in Eclipse typically points to a Java and Eclipse architecture mismatch. Properly verifying and configuring the compatible versions will resolve this startup error.


Related reading
Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions