Eclipse: JVM Terminated. Exit Code=-1 SOLUTION

by troy on June 8, 2008

Recently, for unknown reasons, starting up Eclipse gave me a nasty screen of errors, starting with:
JVM Terminated. Exit Code=-1

eclipse jvm terminated exit code -1

I've been using Eclipse and FDT for years, and this was the first time I've seen that so was stumped for a bit. Doing a search, gave numerous people running into similar problems, but frequently the error code was different, I'm not sure if "Exit Code =1" is a legitimate error or search engine indexing '-1' as '1'

What did work initially was removing the eclipse.ini, but then there wasn't enough memory being allocated for FDT (eclipse.ini has optional arguments '-Xmx' to tell the Java Runtime how much memory to save

Digging it turns

-vmargs was able to turn on/off the error. But then FDT wouldn't have enough memory to run :(

Having had the Java runtime recently upgrade itself to 1.6, thought that was most of it.    In the end, along with some other nasty issues (Explorer.exe taking 50% of the CPU and taking down any process)...I just ended up reinstalling Windows....joy.

It's working now, it  turns out that the first param needs to be in front of the others, and I've had stability issues when the value is high (e.g. MaxPermSize=512M).  Even though I have 3GB Ram, something between the JVM and Windows doesn't like it.

-XX:MaxPermSize=256M
-vmargs
-Xms40m
-Xmx768m

[UPDATE 10-28-08]
There have been several suggestions in the comments, I got this exact issue again when installing FDT 3.1 stand alone. I tried renaming the eclipse.exe to eclipse1.exe, but this appears just to bypass the similarly named eclipse.ini, forcing it to restart to defaults. Which in my case with FDT 3.1 didn't work, as it needs lots of memory. Using the same approach of using an updated config file fixed it, which I've uploaded here:
fdt-3.ini (note rename it to eclipse.ini if you are using eclipse instead of the FDT version of eclipse.

{ 80 comments… read them below or add one }

Michael Ebbage December 15, 2009 at 11:55 am

Thanks, this sorted my issue.

I removed the existing JVM settings in the Eclipse.ini with your suggestion – now I’m running again :D

zomb December 19, 2009 at 8:48 am

I’ve tried everything on the site with no results.

After I updated Eclipse to Galileo (was Ganymedes) it stopped working

I tried renaming the file, and the error message, while still exit code -1, just changed.

I installed a very old eclipse 3.2 that I found lying around, and that doesn’t work either.

Re-installing the java jre with the newest 64-bit didn’t for either eclipse.

I don’t know what else to try besides re-installing windows vista.

troy December 19, 2009 at 9:02 am

Maybe you have a rogue JVM? try uninstalling all the java JRE/JVMs, test Eclipse – it shouldn’t be able to start, then install the JRE that worked. try a fresh eclipse folder, that out of the box with no plugins shouldn’t give you any issues. Unfortunately I’m just shooting in the dark.

Don December 20, 2009 at 8:50 pm

Being specific about the vm in eclipse.ini works.
-vm
c:\path..\javaw.exe

I believe QuickTime overrode the default jvm in XP.

zomb December 21, 2009 at 11:58 am

Uninstalling & chocking if there are no rogues (there were none) and reinstalling didn’t work

These are the errors I get.
[IMG]http://i288.photobucket.com/albums/ll196/zomb1986/eclipseerror.png[/IMG]

Left the original eclipse.exe, right the one I renamed.
For your convenience, I highlighted in red the parameters that are missing on the right.

Dr Mhz January 10, 2010 at 9:07 am

Waleed’s suggestion was an ez fix. Thanks!

Start Chrome and run the java test from java.com. This ‘jump started’ the JVM and then eclipse started working.

Andres January 14, 2010 at 1:27 am

I was having the same issue with eclipse until I installed the Eclipse IDE for Java Developers

Diman January 19, 2010 at 2:46 am

Facing the same error message with “eclipse-jee-galileo-SR1-win32″ in my Win XP. After long trying I simple removed in eclipse.ini this lines:
——————————————————
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
——————————————————–
now it starts and works!?

Bill Lahti January 20, 2010 at 7:29 am

It looks people have found explanations and got their Eclipses going again. But I’d like to add one more thing to look for.

I had all the same problems with Eclipse. Mine turned out to be a virus: Packed.Win32.Krap.X, which had somehow invaded the heap address space of Eclipse. I ended up restoring Windows XP (although I should have tried a few more things suggested by Zone Alarm — I found them too late). Problem with Eclipse and my ancient Gnu Emacs went away.

By the way, changing the max heap size provided the clues that helped. I found it did not run with -Xmx256m but would run with -Xmx192m. Then I got a strange warning that my task manager had been disabled by an admin. That and a Google search being redirected to some place trying to sell me stuff.

zomb January 23, 2010 at 10:04 am

I found the fix that worked for me!

I had to install 32-bit JRE beside my 64-bit JRE, and now it works. (I had to lie about my operating system on Sun’s website to obtain it O_o)

I found out about this through an unrelated update of Vuze, which complained it did not find a JRE, and after pointing it to it, it complained that it was damaged and not a valid 32-bit JRE.

Amit January 25, 2010 at 5:08 am

Thanks buddy…
I removed eclipse.ini and it worked :-) You saved lot of my time.. Thanks again..

Cheers,
Amit

django January 27, 2010 at 6:29 pm

After following Diman suggestion, I was able to get eclipse working again.

btw, this might have happened when my PC was infected with InternetSecurity 2010 virus..

thanks.

Rommel February 3, 2010 at 12:44 pm

This is what I have for the eclipse installed from this zip file eclipse-jee-galileo-SR1-win32.zip and it works. But changing the -Xmx to 2048m stops right there.

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx1024m

Sikor February 24, 2010 at 10:49 am

I tired editing eclipse.ini nothing worked. Finally I deleted the file and similarly to Amit everything works fine again :).

T

Pthom March 11, 2010 at 4:14 pm

I have a similar puzzling problem… i am invoking eclipse using these arguments
-vmargs -Xmx512m -XX:MaxPermSize=256m, it throws me the error JVM terminated exit code 1 …. error . If I reduce these numbers down to the default, it works fine
-vmargs -Xmx256m -XX:MaxPermSize=256m but later gives a out of memory error when executing the code. it even works up to Xmx487. not more than this!!!

Eclipse points to JDK1.5_0_22 and runs on windows server 2003 having more than 20 GB memory. I tried some of the options above like deleting the eclipse.ini . none of them works.
The same code runs fine on my laptop with 1 GB ram without any out of memory errors.

Any suggestions are welcome. thanks in advance.

chaitu41 March 15, 2010 at 10:07 am

Even i have same problem.I deleted eclipse.ini file and it started working

pthom March 15, 2010 at 6:23 pm

I was able to fond the solution for my issue, It was due to citrix presentation client restricting java from assigning more than a certain JVM heap space. The issue and the patch fix for this solution is present here – > http://support.citrix.com/article/CTX115868

RavI March 17, 2010 at 12:26 pm

Worked like a charm.
Thanks,

ayrer February 27, 2012 at 7:39 pm

I ran into the same problem, but changing or removing “eclipse.ini” file made no difference. However I had recently added JAVA_TOOL_OPTIONS to set my Windows environment to a default of UTF8 encoding. When I removed that option, eclipse came up fine.

More info:
On Windows XP, you can access the environment variables by right
clicking on “My Computer”, selecting “Properties”, switch to the
“Advanced” tab and click “Environment Variables”. In that window, you
should be able to see if the environment variable has been set up.

Alternatively, you can open a command prompt and type “SET” to see what
environment variables have been set.

Ian March 21, 2012 at 2:14 pm

It works for Oracle Guardian (diagnostic tool based on Eclipse) too. Just remove guardian.ini
Thanks!

Saurabh Maganlal Agrawal April 13, 2012 at 1:43 am

This JVM crash happens because of less memory available while initializing Java Tooling in Eclipse.

Mere removing those VMargs options (from eclipse.ini) doesn’t help most of the time,
You need to look at the values actually set there and set them as per available resources (almost all the time, you need to reduce them).

In my case, values were:

–launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

I set them to:

–launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx256m

Thanks,
Saurabh Agrawal
Shirpur

Gopal June 9, 2012 at 3:26 am

Thanks.. good job. really helped me.

bethe August 8, 2012 at 5:56 pm

Removing the ini worked for me, thank you!

lalo August 9, 2012 at 12:12 pm

I installed Java from java.com and JDK, it works if I launch it from the shell “eclipse -vm c:\jre7\bin\javaw.exe”, but if I try to launch it directly with the .exe file, it fails, at least it worked, I’ll check it later in detail.

Tarun August 28, 2012 at 4:38 pm

I was getting a similar error msg, so the solution I found was that i was running a 64 bit version of the JDK with 32 bit version of eclipse. Since I had to stick to using 32 bit eclipse, I installed a 32 bit JDK with it & now it works like a charm.
PS – I am running windows 7 64 bit version on my machine.

Goubi September 20, 2012 at 8:37 am

I got the same error code with my IBM RAD 7 and the solution is described there : http://www-01.ibm.com/support/docview.wss?uid=swg21255195

It was a buffer issue about the Xshareclasses option, maybe it can help you …

Ramakanth April 1, 2013 at 3:41 am

Eclipse: JVM Terminated. Exit Code=-1
Resolved issue with below solution…. Thanks a lot one and all….

-XX:MaxPermSize=256M
-vmargs
-Xms40m
-Xmx768m

Ravi April 2, 2013 at 4:11 pm

–>Deleted the eclipse folder.(Make sure you have the .zip)

–> Restarted the machine

–> Add to the eclipse.ini the following code:

-vm
C:\Program Files\Java\jdk1.6.0_07\jre\bin\javaw.exe

–> Saved the file

–> Eclipse started working again

siddaling April 23, 2013 at 1:44 am

I faced similar issue ,
solved this issue by installing different version of java .
I was getting the issue when i used java version : jdk-7u21-windows-x64.
so i removed the above version and installed : jdk-6u13-windows-i586-p.

After this change eclipse started working without any issue.

Thx

Parul September 13, 2013 at 5:24 am

Thanks to Tarun I was finally able to run eclipse.

Leave a Comment

 

{ 3 trackbacks }

Previous post:

Next post: