Question
What does it mean when STS launch fails with the error 'Java was started but returned exit code=13'?
Answer
The error 'Java was started but returned exit code=13' when launching a Spring Tool Suite (STS) usually indicates a problem with the Java environment setup or compatibility issues between the Java version and STS. This guide will help you understand the causes of this error and how to resolve it effectively.
# Example STS.ini modification
-vm
C:/Program Files/Java/jdk1.8.0_201/bin/javaw.exe
# Make sure to replace the path with your Java installation path.
Causes
- Incompatible Java Runtime Environment (JRE) version installed
- Incorrect Java version set in STS configuration
- Java installation corrupted or incomplete
- ST-based application and Java bit-version mismatch (e.g., 32-bit vs 64-bit)
Solutions
- Ensure that you have the compatible version of Java (JDK) installed that matches the STS version.
- Update the STS configuration to point to the correct JDK by modifying the 'STS.ini' file to include the path to the correct JDK installation.
- If you're facing bit-version issues, ensure that both STS and Java are either 32-bit or 64-bit versions.
- Reinstall Java to fix any potential corruption or missing files in the installation.
Common Mistakes
Mistake: Not checking the bit-version compatibility between STS and Java.
Solution: Always ensure that the bitness of the Java version matches that of the STS.
Mistake: Modifying the STS.ini incorrectly or omitting necessary parameters.
Solution: Carefully edit the STS.ini file and include the JVM path without altering other necessary configurations.
Helpers
- STS launch error
- Java exit code 13
- Spring Tool Suite error
- Java compatibility issues
- STS configuration fix