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.

{ 3 trackbacks }

Rien de spécial » Blog Archive » Eclipse. JVM Terminated -1
August 7, 2008 at 7:01 am
Java on Mac « dctucker’s developer blog
March 30, 2009 at 12:11 pm
links for 2009-06-22 « that dismal science
June 22, 2009 at 3:32 pm

{ 68 comments… read them below or add one }

alex2308 July 2, 2008 at 10:08 am

same problem here.

solution: changing “-Xmx512m” to “Xmx256m” in eclipse.ini

Waleed October 1, 2008 at 6:15 pm

Same problem here. Two recent updates on my computer that could be relevant are: java vm auto update, and installing the Chrome browser. My bet it’s the java vm update, but I have no way to prove it.

After digging a little bit, I realized that the java vm could not be created. However, if I open the java.com site with Chrome and do the install verification process it works. And after that step, Eclipse works as well. Looks like the browser managed to get the vm running and eclipse just used it.

swathi October 13, 2008 at 3:29 am

Solution : Just rename ur eclipse.exe to eclipse1.exe and restart ur server. It will work.

brian October 15, 2008 at 1:10 pm

Wow he’s right, running the check to start up the jvm worked. I also had the same possible changes, a java auto update and installing chrome so I’m not sure which is the cause yet. This is on Vista

LNIngram October 21, 2008 at 9:34 pm

Tried to run GoToMeeting using Chrome, which kicked off a Java autoupdate – and this, in turn, produced a box with this error: “VM terminated. Exit code =-1″ — copied a friends’ eclipse.ini file, to no avail. Then tried swathi’s solution (#4) – no idea why, but it works.

alan October 23, 2008 at 3:22 am

download JRE 1.5.0 any update, create a shortcut ‘eclipse -vm …\jre1.5.0_15\bin\javaw’, take eclipse to point JRE 1.5.0 virtual machine, try it!

Torso December 16, 2008 at 6:35 am

Thanks alan this works!

javaStud January 20, 2009 at 10:01 am

I had the same problem – eclipse just stopped working all of a sudden after a corporate update. I tried all other suggestions on this site, and lastly tried what Swati recommended, and believe it or not, that’s the only one that worked (renaming the eclipse.exe!!!)

niv February 1, 2009 at 6:20 pm

here what solved it for me:
eclipse1.exe” -vm “c:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe”

Puneet February 21, 2009 at 2:27 am

Hi All,

Updating eclipse.ini was saver for me. Cheers guys.

HadesScorn March 1, 2009 at 3:38 pm

Thanks for this, I was able to figure out my issue as a result.

For me, the issue came from running Windows 7 64 bit. I had a 32bit JRE due to Firefox, but when I DLed JDK I automatically got their 64 bit version. Turns out that eclipse does not work with said 64bitJDK [at least in Windows, perhaps their Linux 64bit distro works]. I DLed the 32bit JDK and pointed eclipse to it using the “-vm” command, and I was up and running.

dezmondo May 3, 2009 at 10:46 am

Waleed’s solution worked for me. It was because i was using Google Chrome. Simply went to the Java website, went for the download and it recognised i was using chrome. Then when i went to run Eclipse, it downloaded additional components and ran as it did previously.

Pranay May 6, 2009 at 8:59 pm

Even I was facing same problems for 2 weeks. I tried changing the Java preferences and running eclipse it was not working. At last I found the way to run it.

If you have installed JDK 1.6 on a 32 bit system, eclipse will not work. To remove the JDK 1.6 you need to remove all versions of Java installed on your system. You can remove that using following command.

sudo rm -rf /System/Library/Frameworks/JavaVM.framework/Versions/

Once you remove java, you can check it using the Terminal and giving command
java -version

Now its time to install JDK 1.5 on your system. To get the Java update visit this link and download and Install this update.

http://www.apple.com/support/downloads/javaformacosx105update2.html

Next step is to set default JDK for your system.
Go to Applications->utilities->Java->Java Preferences
Drag J2SE 5.0 (32 bit) to the top level in both Java Applet Version and Java application Version.

Now you all set
Check the current version using java -version command at termnal.
It will show like

java version “1.5.0_16″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

Now run eclipse in normal way, it will come up.

Thanks

-Pranay Kondekar

super_tycoon May 11, 2009 at 11:42 pm

I had this exact problem after I installed Windows 7 RC1 32bit. I used chrome to download the java vm. Decided to do some work, and Eclipse wouldn’t work. Followed Waleed’s advice, went back the java website and went to the “How do I test whether Java is working on my computer?” page underneath the download button. It eventually loaded and Eclipse started to work as well. As a note, this was the latest Chrome, 7, JVM, and Eclipse as of 5-11-09. Hopefully this will work for you, it is definitely the easiest solution.

Renu May 28, 2009 at 2:08 am

The option is to manually delete the cache file, which is C:Documents and Settings\Local SettingsApplication Datajavasharedresources. Navigate to the directory and look for a file called C23D1A32_sharedoc__G01 and delete this file.

KC May 28, 2009 at 4:22 pm

I tried Swathi’s and it worked like magic. But, still don’t understand how/why it worked.

taichimaro June 1, 2009 at 3:54 pm

Hello,
the same problem :
jvm terminated.Exit code=-1
-Dosgi.requiredJavaVersion=1.5
……
the solution :
changing eclipse.exe to eclipse1.exe and 512 to 256 in the eclipse.ini
good luck

sridhar June 6, 2009 at 4:41 am

Hi,
I am also having same problem.
JVM terminated. Exit code=1
/usr/bin/java

I am using RHEL.

i have tried ./eclipse -vm /Softwares/jdk1.5.0_06/jre/bin/javaws
also. But still getting error.
Any one haiving idea abt this on Linux.
Thanks in advance.

Sridhar

cesar ec June 10, 2009 at 1:39 pm

Alan’s solution works for me. I created a shortcut:
eclipse -vm /usr/lib/jvm/java-6-sun/bin/java

(i work on ubuntu 9.04, and i had installed “sun-java6-jre” in Synaptic)
my eclipse stopped when i rebuild the index, now after rebuild the index everything is going ok

Lance Douglas June 10, 2009 at 4:36 pm

I ran into this and noticed the following error on my command line:
“cannot restore segment prot after reloc: Permission denied”

Which led me to this resolution; which works:

http://www.appistry.com/community/forums/content/cannot-restore-segment-prot-after-reloc-permission-denied

pedro June 11, 2009 at 1:48 pm

eclipse1.exe worked for me in XP Pro 64bits

Daphne June 14, 2009 at 11:27 am

Changing the name of the exe file works because it is no longer equals to the name of the ini file, which is the one causing the problem (something with the max value of memory). Therefore it is not really a solution since I want to use the current defenitions in the ini file and not the default ones.

corey June 17, 2009 at 8:42 pm

thanks HadesScorn,

I’m using windows 7 64 bit and tried almost everything with no avail, but then downloaded the 32 bit JDK and pointed to it from eclipse and it worked.

shank June 18, 2009 at 12:20 am

I get the same JVM terminated EXit Code =-1
am unable to paste the snap shot here.can somebody tell me how to do it.so that I can show my problem clearly

Taher Ahmed June 24, 2009 at 7:51 am

Renu’s comment work for me..
Deleting the shared file in the c:\Documents and Settings\\Local Settings\Application Data\javasharedresources\ makes my RSA work fine again.

Dan Moore June 25, 2009 at 7:04 pm

Hi folks,

I ran into this issue after an upgrade to eclipse (3.4). I fixed it by creating a default.ee file in the directory with eclipse.exe. In ‘default.ee’, I put whatever vm options I wanted, and eclipse started right up.

Here is a list of all options that can go in an ee file: http://wiki.eclipse.org/Execution_Environment_Descriptions

And here’s the bug that pointed me to this solution:https://bugs.eclipse.org/bugs/show_bug.cgi?id=143799

Hope this helps.

nidhi amol ramakant July 20, 2009 at 1:18 am

deleting eclipse.ini worked well for me…. :)

Ananda Bhaumik July 23, 2009 at 2:37 am

Renu’s solution worked for me. Thanks Renu! Thanks everyone!

Anjusha July 23, 2009 at 11:09 pm

Try renaming ur profile and creat a new one. It worked for me.

RG July 25, 2009 at 3:14 pm
TLT August 5, 2009 at 10:34 am

I encountered this problem and cannot even identify a system change that might have caused it. I had not changed my Eclipse version or my JVM version. I am running Win XP Pro SP 3. But renaming my eclipse.ini file seems to have solved the problem.

ritu August 12, 2009 at 12:01 pm

changing eclipse.exe to eclipse1.exe works
thnx

Avik Mitra August 13, 2009 at 4:51 am

Thanks…. it helped me lot…

Avik & Gourab

Matt Brown August 19, 2009 at 12:17 am

I deleted most of the contents of my eclipse.ini, then added lines back a few at a time. There is a line that is simply “-showsplash” that was causing the problem for me. Removing it makes Eclipse work, adding it back causes the error you are seeing.

It may not be everyone’s problem, but it was mine…

gungor August 22, 2009 at 9:13 pm

Thanks alex2308 ;
“solution: changing “-Xmx512m” to “Xmx256m” in eclipse.ini”

It works…

//GG

Todd August 24, 2009 at 3:52 pm

It seems the eclipse.ini becomes ‘corrupt’. I used notepad to edit eclipse.ini replacing all strange characters with the desired newline or space characters, but otherwise left it as is.
-showsplash org.eclipse.platform
–launcher.XXMaxPermSize 256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

Works!

yashaswi August 29, 2009 at 8:49 pm

Hi.. I have been receiving these errors ..ever since i upgraded my rational software architect 7.0.. which also upgraded my eclipse version.. Ok .. here is the error message which was generated..

JVM terminated. Exit code=127
/opt/IBM/SDP70/jdk/jre/bin/javaw
-Xquickstart
-Xms40m
-Xmx1028m
-Xgcpolicy:gencon
-Xscmx96m
-Xshareclasses:singleJVM,keep
-XX:MaxPermSize=512M
-jar /opt/IBM/SDP70/./startup.jar
-os linux
-ws gtk
-arch x86
-launcher /opt/IBM/SDP70/./eclipse
-name Eclipse
-showsplash 600
-exitdata cc8007
-vm /opt/IBM/SDP70/jdk/jre/bin/javaw
-vmargs
-Xquickstart
-Xms40m
-Xmx1028m
-Xgcpolicy:gencon
-Xscmx96m
-Xshareclasses:singleJVM,keep
-XX:MaxPermSize=512M
-jar /opt/IBM/SDP70/./startup.jar

JMJones August 31, 2009 at 10:18 am

I’m a newbie to programming java, in fact I consider myself at this point a dumb html guy. I’ve only been working with Java and eclipse for about a month and when I hit this startup problem I had no idea what to do. This forum was a godsend!

I don’t know what I did, but I must have done something to cause this. Anyway, I followed the suggestion of changing the -Xmx512m to -Xmx256m in the .ini file and it worked like a charm.

Thanks!

jitendra September 8, 2009 at 5:56 am

hi..
I am same problem on installation on eclipse they have a fix jvm is terminted….so you have help me installation on eclipse.

ByeRoCk September 16, 2009 at 6:36 pm

Updating eclipse.ini was solved the problem.
Cheers.

–>same problem here.
–>solution: changing “-Xmx512m” to “Xmx256m” in eclipse.ini

epikur September 20, 2009 at 5:33 am

Eclipse: JVM Terminated. Exit Code=-1
after Java 6 was downloaded and installed

Updating my eclipse.ini file solved it for me
I deleted the duplicate –launcher.XXMaxPermSize 256M in the file.

BEFORE
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.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
-Xms40m
-Xmx512m

AFTER
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.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
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

dushyant October 1, 2009 at 6:40 am

i just want to thanks swathi…….. swathi u r great…….your solution is right and simple…….

hellyeah666 October 2, 2009 at 8:20 pm

thanks HadesScorn,
I’m using windows 7 64 bit and tried almost everything with no avail, but then downloaded the 32 bit JDK and pointed to it from eclipse and it worked.[2]

This work for me..good luck.

Ismael October 7, 2009 at 3:39 am

Muchas Gracias. Me ha servido de mucho

Tarah M. Wheeler October 29, 2009 at 6:24 pm

Thx, HadesScorn!

I’m using Win 7 RTM; the 32-bit JDK works like a charm.

Mykola November 17, 2009 at 7:23 pm

I simply added -vm option to the eclipse.ini to use jdk 5. Here is how it looks like now:

-vm
C:\Program Files\Java\jdk1.5.0_19\bin\javaw.exe
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx1024m
-Djava.net.preferIPv4Stack=true

Elakkiya November 21, 2009 at 9:55 am

Thanks a lot dear friends . I was having that problem. and got out of it by renaming as eclipse1.exe thanks a lot

cataxxx November 28, 2009 at 6:42 pm

Gungor, thanks a lot, that was the perfect solution, it works for me now.

gungor August 22, 2009 at 9:13 pm

Thanks alex2308 ;
“solution: changing “-Xmx512m” to “Xmx256m” in eclipse.ini”

It works…

//GG

PtitBoudha December 7, 2009 at 11:26 am

Deleting file in directory C:\Documents and Settings\«your_username»\Local Settings\Application Data\javasharedresources\ worked for me. Thank’s Renu.

Kid102 December 10, 2009 at 5:46 pm

Thanks HadesScorn!!

I’m running windows 7 64-bit JDK 6 64-bit and I couldn’t get eclipse php to work for the life of me none of these other solutions worked.

Simply install jdk 32-bit, point using VM command and viola

Why doesn’t eclipse just detect and verify or install the correct JDK instead of all this mess??

Leave a Comment

Previous post:

Next post: