Eclipse - Java was started but returned exit code=13
Steps -
1. Set the JAVA_HOME Variable
- Right-click the My Computer icon on your desktop and select Properties.
- Click the Advanced tab, then click the Environment Variables button.
- Under User Variables, click New.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path for the Java Development Kit.
- Click OK.
- Click Apply Changes.
2. Update the Path variable
- Right-click the My Computer icon on your desktop and select Properties.
- Click the Advanced tab, then click the Environment Variables button.
- Under System Variables, click New..
- Create the variable value as the installation path for the Java Development Kit.
- Click OK.
- Click Apply Changes.
Even after Updating JAVA_HOME and Path variable, issue continued with below exception
Instead of referring to updated installation path, eclipse was referring to above highlighted path.
3. Open Command Prompt - execute below commands
3.1 java -version
3.2 javac -version
java and javac are referring to different versions of jdk
Under System Variables, Delete C:\ProgramData\Oracle\Java\javapath . unfortunately this didn't worked and java and javac still continued referring to different versions of jdk
4. After investigating an bit,In C:\ProgramData\Oracle\Java\javapath - .symlink files are default created during installation (ProgramData) is an hidden folder -
take an backup and flow below steps
- Delete all symlinks under this folder(symlinks are not shortcuts)
- Open a command prompt in the same directory and create new Symlinks using the "mklink" command.
How to create symlink - Navigate to installation path\bin folder in command prompt and execute below commands -
1. mklink java java.exe
2. mklink javaw javaw.exe
3. mklink javaws javaws.exe
After you execute above commands you could view symlinks created -
|
Add caption |
Copy paste the java.symlink , javaws.symlink and javaw.symlink to C:\ProgramData\Oracle\Java\javapath folder - and execute java -version and javac -version command to verify jdk versions.
This should work fine - But if it still refers to different version of JDK then - Just copy paste
1. java.exe
2. javaw.exe
3. javaws.exe
file from installtion path/bin folder to C:\ProgramData\Oracle\Java\javapath folder execute java -version and javac -version command to verify jdk versions.
This should work fine .
- Happy Learning