Fix Java Was Started by Returned Exit Code=1

This tutorial demonstrates how to solve the Java was started by returned exit code=1
error in Java.
Fix the Java was Started by Returned Exit Code=1
Error
The error Java was Started by Returned Exit Code=1
while using eclipse. This error terminates the currently running JVM by initiating the shutdown sequence.
The reason for this error is that there may be something wrong in the eclipse.ini
file. Here is the part of the error message for Java was Started by Returned Exit Code=1
:
Java was started but returned exit code=1
C:\WINDOWS\system32\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v22.0.5-757759
-XX:MaxPermSize=256m
-jar
This error occurs because the Java Virtual Machine path is not correctly given.
To solve this error, follow the steps below:
-
Make sure the JDK is successfully installed on your system.
-
Open the
eclipse.ini
file from the Eclipse folder and make sure the path of JVM is correct, as given below:-vm C:\Program Files\Java\jdk-17.0.2\bin\server\jvm.dll
-
Make sure the
-vm
option is before the-vmargs
option.
Here is the full setting for the eclipse.ini
file:
-startup
plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
C:\Users\Sheeraz\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650
-product
org.eclipse.epp.package.java.product
-showsplash
C:\Users\Sheeraz\.p2\pool\plugins\org.eclipse.epp.package.common_4.22.0.20211202-1200
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk-17.0.2\bin\server\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dsun.java.command=Eclipse
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Xms40m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=https://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.
LinkedIn FacebookRelated Article - Java Error
- Fix the Error: Failed to Create the Java Virtual Machine
- Fix the Missing Server JVM Error in Java
- Fix the 'No Java Virtual Machine Was Found' Error in Eclipse
- Fix the Error: Failed to Create the Java Virtual Machine
- Javax.Net.SSL.SSLHandShakeException: Remote Host Closed Connection During Handshake
- Java.Lang.VerifyError: Bad Type on Operand Stack