Lex
Lex

Reputation: 355

JVM terminated. Exit code = -1

I've been using Eclipse for some time already, and I didn't have any problems with it. However, when I tried to generate some javadoc, I found that I didn't have the SDK installed. I installed jdk 6u23, and from then on, Eclipse hasn't been working.

At first it told me it couldn't find a JRE/SDK. After copying and placing the JRE in the Eclipse folder, the error changed to this:

http://i258.photobucket.com/albums/hh261/magical_7/Eclipse.png

I've searched around for some solutions, and found a few of varying nature. However, none of them seemed to work. I've tried emptying my eclipse.ini file without success. Altering some values in eclipse.ini didn't work either. Installing Java SDK 1.5 didn't work.

Does anyone have other possible solutions?

Update: I tried reinstalling Eclipse, but it didn't fix the problem. I did notice that it's a 32bit version, while I'm running a 64bit system. However, if this were to be the problem, I find it strange that it hasn't been an issue earlier.

Update 2 I've reinstalled both Eclipse and Java once more, and everything works again.

Upvotes: 15

Views: 108424

Answers (22)

user20642297
user20642297

Reputation: 1

I have the same error. It might be because your PC was forced to shut down at night.

My solution was go to the path C:\Users\<find your user profile>\AppData\Local\javasharedresources and delete the file inside this folder

Upvotes: 0

Siva_Munnaluri
Siva_Munnaluri

Reputation: 21

I am able to solve same issue by specify the -vm C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe in eclipse.ini.

Upvotes: 0

Manuel
Manuel

Reputation: 691

If you encounter a problem like this you can get a little more information by using eclipsec.exe from a command-line instead of eclipse.exe. I got this additional info in the dos box:

C:\<...>\Eclipse>eclipsec
Error occurred during initialization of VM
Could not reserve enough space for object heap

So I lowered my -Xmx setting in eclipse.ini from 1024 to 768, which made it work again. Why this was suddenly necessary I do not know atm, Eclipse has been running fine with 1024m some days ago.

Upvotes: 0

Rajaguru
Rajaguru

Reputation: 1

I had encountered the same type of the popup message when i am opening IDT app in SAP. It has been resolved after reduced below value

Option Name: _JAVA_OPTIONS

value: -Xms512M -Xmx1024M ( Previously -Xmx2048)

Upvotes: 0

Vivek Vermani
Vivek Vermani

Reputation: 2004

There could be many possible causes for this error. It could be that compatible mode is not selected in windows 7 , path or eclipse.ini problem.

Upvotes: 1

Jorduino
Jorduino

Reputation: 61

I added the new JRE to the eclipse.ini file and updated my PATH. Seemed to work for me.

Upvotes: 0

Hannan Ali Khan
Hannan Ali Khan

Reputation: 1

There is no need for reinstalling eclipse IDE or changing your environment variables. I had encountered this problem while working on my project I had this issue but I fixed it in no time and it works fine for me.

Before implementing any solution, Check first that you don't have multiple installations of JDK in your system. I have encountered many systems with JDK 1.7 and JDK 1.8. If it is so, simply change your -vm to the alternate jdk C:\Program Files\Java\jdk1.7.0_60(jdk version you were not using)\jre\bin\client\jvm.dll and start your eclipse IDE. IT will work but the workspace will not synchronized and the files will not be getting displayed. Just close your IDE and revert to your previous jdk link and Voila It works.

In case you have a single JDK installed in your system. I suggest clearing your CPU Physical memory. It so happens JVM has issues in execution if a lot of memory is utilised. Just go to the Task manager and close any redundant processes.

Hope this helps! Keep Coding :)

Upvotes: 0

Satish
Satish

Reputation: 1

I resolved it by installing 32 bit JDK and editing eclipse.ini to point to 32 bit jdk . Added -vm C:\Program Files (x86)\Java\jdk1.7.0_71\bin at the end of eclipse.ini file. Note: I have my JAVA_HOME pointint to 64 bit JDK

Upvotes: 0

user2552831
user2552831

Reputation: 11

I added the entry in the Path environment variable to the jdk bin folder and it started working

Path = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Application Virtualization Client;C:\Program Files\Java\jdk1.6.0_18\bin

Upvotes: 1

Ajit Singh
Ajit Singh

Reputation: 11

First Approach:

  1. I added below lines in eclipse.ini

    -vm C:\Program Files(x86)\Java\jre\bin\java.exe
    
  2. Modified below line in eclipse.ini (changed to 1.6.0_37 from 1.5),

    -Dosgi.requiredJavaVersion=1.6.0_37
    
  3. Deleted JAVA_HOME from environment variables which was pointing to c:\jdk1.6

Now Eclipse is working fine.

Second Approach:

Another way - don't add below line in Eclipse and only modify JAVA_HOME to point to C:\Program Files(x86)\Java\jre,

-vm C:\Program Files(x86)\Java\jre\bin\java.exe

Eclipse should work now.

Upvotes: 1

andro
andro

Reputation: 11

In my case the cause was a corrupted eclipse.ini file. I had been editing the file, and accidentally changed -Xmx512m to -Xmx512

Upvotes: 1

sayannayas
sayannayas

Reputation: 774

I tried all the solution still didnt find my luck.Lastly i got it resolved by pointing to client jvm.dll in eclipse.ini file

-vm   
C:\jdk160_05\jre\bin\client\jvm.dll 

I made a series of trials which you may find useful if you face the same and not getting resolved yet

exit-code-1

Upvotes: 0

shashwat
shashwat

Reputation: 1

This problem occure in the case, when you are using 64 bit OS on 32 bit motherboard. Now, it can be resolved easly,

First uninstall 64 bit java and install 32 bit java. and set environment variable with jdk path.

Upvotes: -2

Chan.Android
Chan.Android

Reputation: 21

If you have got a problem like that, you should change the path of jre.

Firstly, computer> properties > advance system setting > Environment variables > find "path" under system variables then give the directory of your jre/bin. (for example C:\ Program Files\ java\ jre\ bin)

Upvotes: 2

Max Gordon
Max Gordon

Reputation: 5457

I had the same problem and it turned out to be a problem with 64-bit versions. My solution was removing all my Java programs and reinstalling the 64-bit JRE (I had downloaded the 64-bit Eclipse).

Upvotes: 0

Please add "-vm" option to the eclipse.ini file available in the same folder as eclipse.exe.

The -vm option should point to the javaw.exe located in your machine, something like the below.

-vm C:\Program Files(x86)\Java\jre\bin\jawa.exe

After adding the above line to eclipse.ini save it. Now clicking eclipse.exe will automatically launch the IDE.

Upvotes: 0

Rajiv
Rajiv

Reputation: 1

You just click on startup on eclipse folder and open the eclipce or right click on startup and click open with last javaw, then you can find solution.

Upvotes: -1

Shashank Kadne
Shashank Kadne

Reputation: 8101

Remove the default value "256m/256M" from the eclipse configuration file (eclipse.ini).

You will find this line just below "--launcher.XXMaxPermSize".

Upvotes: 8

Zaw Htet Han
Zaw Htet Han

Reputation: 41

Edit your Environment Variables >> System Variables >> Path to

C:\Program Files (x86)\Java\jdk1.6.0_24\bin;

(NOT C:\Program Files\Java\jdk1.7.0_01\bin;)

it should work

Upvotes: 4

Irik
Irik

Reputation: 11

I just had the same problem on Windows 7, 64 bit. I reinstalled Java 32 and Java 64, and Eclipse, but it did not fix the problem. I found that in eclipse.ini the Dosgi.requiredJavaVersion was 1.5, so I changed it to Dosgi.requiredJavaVersion=1.6.0_25. In the Environmental variables I added to the PATH %JAVA_HOME%\bin;C:\Program Files (x86)\Java\jdk1.6.0_25\bin. These changes fixed my Eclipse problem.

Upvotes: 1

blissfool
blissfool

Reputation: 1007

I had similar issue: Eclipse IDE fail to launch with JVM Terminated. Exit code=-1

One thing that worked for me is to set -Xmx to 256m in eclipse.ini. If that is not good enough for you, you may also try using different JVM module than the one that eclipse uses by default.

If you look in the error dialog in your screen capture, you'll notice that the "-vm" option using "jvm.dll" as JVM. If you change it to use javaw.exe in your JAVA_HOME\bin folder, the problem should go away.

I'm still clueless as to what the difference is between using jvm.dll vs javaw.exe. Maybe jvm.dll is suppose to be used only for light-weight embedded java applet and it can't handle the load brought on by a full stand-alone Java UI software.

Upvotes: 1

Raghuram
Raghuram

Reputation: 52635

Perhaps you should reinstall Eclipse. Then you can add the JDK through Windows -> Preferences -> Java -> Installed JREs.

Upvotes: 1

Related Questions