Eclipse : Java was started but returned exit code = -1

I was having eclipse on my system (eclipse 3.6 – helios version), and a week ago, I decided to set it up for doing Android programming in Java.

When I opened Eclipse, I got the following error :

Java was started but returned Exit Code = -1

The error was same as shown in this image ( i have taken this image from the world wide web )

I googled this error and found that many people had faced the same error and there were many solutions available to this problem.

Most Common Solution : One of the most common solution that I found was of adding some lines to eclipse.ini file, For example: The path to the javaw.exe file. Adding some arguments to eclipse.ini file was also suggested.

This solution had solved the problem of many people, but, it lead to some other errors in my case( example : unable to find java virtual machine on the specified path).

I tried re-installing eclipse but the problem remained as it is.

Then, I decided to re-install my jdk and jre to the latest versions that were available.

I removed all the older versions and re-installed latest available versions of jdk and jre.

When I tried starting eclipse again, it started.

This solved my problem :)

If you are facing the same problem, then I suggest you give it a try once to re-install jdk and jre, and, see if it can help.

All the best!! :)

About these ads

10 thoughts on “Eclipse : Java was started but returned exit code = -1

  1. It’s solved. Thanks

  2. Installing a new Eclipse and JDK did not work for me.

    It was only when I installed the latest JRE that the problem went away.

  3. If this started happening when seemingly nothing has changed with respect to your eclipse and java installations, and there is a chance that this started happening after a system (Windows) crash or an unexpected eclipse shutdown, the problem may be due to a change in the compatibility mode of eclipse.exe. When the system or eclipse crashed, Windows may have decided to change the compatibility mode of eclipse.exe whether you liked it or not.

    Unfortunately, this mode can not be changed through the “compatibility” tab on the file properties. The change has to be made by editing the registry. Look for the two keys:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Persisted
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    Look for any entries for eclipse.exe. I deleted one from each location and this solved the problem for me.

    The compatibility information is tied to the file name and is persisted in the registry even if the file itself is deleted or moved. This is why changing the location of the eclipse directory will solve the problem. This also means that reinstalling eclipse in the same location will not fix the problem since the registry entry will still be there.

  4. I had the same problem, you have to delete -vmargs in your eclipse.ini and it will work.

    • Deleting -vmargs worked for me…earlier suggestions of adding javaw.exe, jvm.dll did not work for me..

      • Thank you very much.
        Deleting the followings worked. But Would it cause another error?

        -vmargs
        -Dosgi.requiredJavaVersion=1.6
        -Xms40m
        -Xmx768m
        -Declipse.buildId=v22.3.0-887826
        -XX:MaxPermSize=512M

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s