- Written by Nam Ha Minh
- Last Updated on 04 October 2019 Print Email
I originally wrote this project in java SE 10.0.2 but want to update everything so that it works with Java SE 13.0.2 and JavaFX 13. It works fine when I use Java 10 (I'm assuming because JavaFX was still included) but with Java 13 everything compiles and runs but nothing ends up showing up (it should pop up a window). One of the issue linked with Eclipse is 'java was started by returned exit code=13' error. This error is mostly faced by java beginners. I faced the same issue while installing the Eclipse in my computer. I found the solution and sharing the 6 different ways to solve 'java was started but returned exit code=13' error in eclipse.In this article, I will guide you how to change JDK/JRE that runs Eclipse IDE, on Windows operating system. First, you need to know exactly which version of Java on which Eclipse is running.
1. Find the JDK / JRE that runs EclipseIn Eclipse, click menu Help > About Eclipse IDE. Then in the About Eclipse IDE dialog, click the Installation Details button. Then in the next screen, click Configuration tab. Wait for a moment while Eclipse is retrieving configuration information, and you will see a screen as below:Find the line that starts with –vm and the value in the next line shows the exact path of JDK/JRE on which Eclipse is running. In the above screenshot, you see Eclipse is running on OpenJDK 11.0.2.
You know, Eclipse IDE is written in Java so it needs a JDK/JRE installed to run. By default, the first instance of JDK/JRE found in the PATHenvironment variable is used to run Eclipse. Consider a typical value of the PATHenvironment variable like this:In this case, the Java Virtual Machine found in the JAVA_HOME path will run Eclipse IDE. So changing the Java version that run Eclipse is just a matter of updating the value of the JAVA_HOME variable.However, sometimes it doesn’t work like that. You changed JAVA_HOME points to a newer JDK/JRE, but Eclipse still runs under the old one. Why? What happens?There are two reasons:
2. How to Change JDK / JRE for Eclipse
- An installation of Oracle Java putting its path before your JAVA_HOME, or
- Your Eclipse IDE is configured to stick with a JDK/JRE in its configuration file.