Thursday, April 14, 2011

My Eclipse 9 : Failed to create Java Virtual Machine

When I installed latest version of My Eclipse ie My Eclipse 9 initially it worked fine for few days latter suddenly it started giving me error Failed to create Java Virtual Machine.



Here is the solution

It gives Failed to create Java Virtual Machine error because while starting eclipse it created JVM of its own. It require enough free cache memory to do so hence if there is not enough memory it give the Failed to create Java Virtual Machine error.

Go to installation directory

Eg :  C:\Program Files\MyEclipse\MyEclipse 9

You will find a file myeclipse.ini

Eg : C:\Program Files\MyEclipse\MyEclipse 9\myeclipse.ini

You need to provide the existing JVM which is already present and need to require recreating. Remove the VM from file myeclipse.ini and add your custom existing JVM

-vm
C:/Program Files/Java/jdk1.6.0_21/jre/bin/javaw.exe

And now when you restart eclipse it will work and wont give Failed to create Java Virtual Machine error.