179

This is a picture of the error code

Here is the content of the error message:

Java was started but returned exit code=1

C:\WINDOWS\system32\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v22.0.5-757759
-XX:MaxPermSize=256m
-jar
D:\Programming\adt-bundle-windows-x86_64-20130729\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher
D:\Programming\adt-bundle-windows-x86_64-20130729\eclipse\eclipse.exe
-name Eclipse
--launcher.library
D:\Programming\adt-bundle-windows-x86_64-20130729\eclipse\\plugins/org.ecl
ipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807\eclipse_1503
.dll
-startup
D:\Programming\adt-bundle-windows-x86_64-20130729\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 1c50_48
-product com.android.ide.eclipse.adt.package.product
-vm C:\WINDOWS\system32\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v22.0,5-757759
-XX:MaxPermSize=256m
-jar
D:\Pragramming\adt-bundle-windows-x86_64-20130729\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar

I just downloaded and dearchived android SDK for Windows. I`m currently using W8 64x.

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
Vladislav Bogdanov
  • 1,891
  • 3
  • 14
  • 10
  • 1
    Check this - https://bugs.eclipse.org/bugs/show_bug.cgi?id=333227 – Khobaib Jan 29 '14 at 14:00
  • 2
    Had a similar issue once, where the error was not caused by the java version, rather it missed the library for some java-agent. Should anyone ever get to this problem :) – Niels Bech Nielsen Jun 03 '14 at 11:29
  • 3
    I also having the same issue. When i installed the 64 bit JDK, this error is no longer able reproduced. – Sudhakar Jul 02 '14 at 11:44

30 Answers30

310

The error message points to a problem with your Java version. Do you have a JDK installed?

Try adding the following (noting the new line):

/!\ make sure, that the -vm option occurs before the -vmargs command. Everything after -vmargs is passed directly to the JVM.

-vm 
c:/wherever/java/jdk1.6.0_21/jre/bin/server/jvm.dll
-vmargs... 

...to your eclipse.ini file, pointing to the JDK you want to use, and check that the required Java version is at least as new as your JDK. This is the path for a Windows system. More on paths can be found here (scroll down).

If you don't know where the eclipse.ini file is: regularly it is in the folder of your eclipse.exe.

Edit2: @KadoLakatt: the reason why installing the latest Java Version worked for you is because Eclipse checks the standard path for a JVM if it doesn't find a -vm entry (see here). However I'd not recommend that, since you might be wrong guessing the JVM used. If you update Java (automatically?) you might run into problems in your Eclipse wondering what you might have changed. Better set it to a specific folder in your eclipse.ini to be certain.

Blag
  • 5,818
  • 2
  • 22
  • 45
Calon
  • 4,174
  • 1
  • 19
  • 30
  • 3
    @KadoLakatt: please provide your own answer next time. Edited my post to address your point, though. – Calon Feb 26 '15 at 06:51
  • 1
    'make sure, that the -vm option occurs before the -vmargs command'...this also helped me a lot along with your answer! – Vikram Jun 11 '15 at 20:41
  • 3
    Make sure you type the line as displayed: with the path on a separate line, not on the same as -vm. – Diomidis Spinellis Jul 29 '15 at 11:49
  • 1
    I had this error with javaw.exe or java.exe, But with jvm.dll everything works OK. Thanks. – cyanide May 04 '17 at 22:23
  • I had a bit of trouble getting this to work. I didn't realize at first that `-vmargs...` meant that you have to actually take the existing -vmargs that was already in the ini file and move it underneath the vm line. After I did that, it worked. Thanks! – rurouniwallace Jan 02 '19 at 02:19
  • 3
    I changed from ".exe" to ".dll", though ".exe" path worked for months earlier. `-vm C:/Program Files/Java/jdk1.8.0_191/jre/bin/javaw.exe` TO: `-vm C:/Program Files/Java/jdk1.8.0_191/jre/bin/server/jvm.dll` – Reddymails Jul 12 '19 at 16:13
  • Why we are using dll rather than exe ? – Jess Aug 23 '19 at 15:56
  • @Jess Sometimes '.exe' does not work. Here's an explanation of the difference between using the two: https://stackoverflow.com/questions/30416413/difference-between-running-eclipse-on-jvm-dll-and-java-exe-or-javaw-exe – Calon Sep 19 '19 at 09:36
  • adding this solved my issue. -vm C:\Program Files\Java\jdk1.8.0_211\bin\javaw.exe – Aru Feb 10 '20 at 23:46
  • Thanks. Same solution worked with Java 12 too. – Atul Jan 25 '21 at 20:19
  • Can also be caused by your defualt JDK being 32-bit, whereas Eclipse is 64-bit. – lafual Jun 10 '21 at 10:50
  • With Windows Defender, I never get such error, but after I switched to Kaspersky Internet Security, replacing eclipse.exe always failed. Now according to another answer's suggestion, I just renamed both eclipse.exe & eclipse.ini to eclipse1.exe & eclipse1.ini before starting eclipse, it works, after eclipse update finished, it created another set of eclipse.exe & eclipse.ini. – Daniel Yang Oct 11 '21 at 01:54
  • This worked for me - the KEY was using forward slashes. I was stuck using back slashes. -vm C:/Program Files/Java/jdk1.8.0_321/jre/bin/server/jvm.dll – Skystrider Mar 16 '23 at 16:12
49

I received this error out of the blue. Eclipse stopped working even though I made no config changes and did not install any new jdk's.

Here was my eclipse.ini file :

--clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/Program Files (x86)/Java/jre7/bin/javaw.exe
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx1024m

To get Eclipse to start successfully I removed

    -vmargs
    -Dosgi.requiredJavaVersion=1.6
    -vm 
C:/Program Files (x86)/Java/jre7/bin/javaw.exe

So here is my updated file :

--clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-Xms40m
-Xmx1024m

I have no idea why removing osgi.requiredJavaVersion=1.6 fixed this as my jvm version is 1.6. From the doc http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

osgi.requiredJavaVersion
The minimum java version that is required to launch Eclipse. The default value is "1.4.1".

I think my java version was set correctly. Anyway Eclipse starts and runs for me now......

blue-sky
  • 51,962
  • 152
  • 427
  • 752
  • 1
    You didn't just remove two lines there but rather four. The -vm parameter was removed as well, and I'd guess that this is what caused the fault. When you do not define the path in the eclipse.ini, eclipse will start with the default JVM you defined. Also note, that everything after the -vmargs parameter is passed to the JVM as a parameter. I am not sure, that your xms and xmx settings still work if you remove -vmargs. – Calon Jul 17 '14 at 12:58
  • 3
    I also removed : -vmargs -Dosgi.requiredJavaVersion=1.6 And now it works! Thanks for the fix! – Dainius Kreivys Jul 22 '14 at 19:09
  • This worked for me, too. I'm not sure why it threw this error when, like you said, I didn't change anything with my Java/Eclipse...weird – user1282637 Mar 04 '15 at 19:28
  • 2
    I got this error on Windows machine after installing "Eclipse SDK" plug-in. Eclipse silently added `-vm C:/Program Files/Java/jdk1.8.0_45/bin/javaw.exe` to eclipse.ini file, requested a restart and then failed to launch. In the past, I'd manually added `-vm C:\Program Files\Java\jdk1.8.0_45\bin\javaw.exe`. Error occurred because I was left with two '-vm' entries. Removing one of them resolved issue. – Hollis Waite May 16 '15 at 13:44
  • I only removed: `-vmargs -Dosgi.requiredJavaVersion=1.6` I have no idea where the hell it came from, the IDE worked just fine in past. – Tomáš Zato Oct 01 '15 at 13:30
  • This was the case for me too. It felt really weird seemingly mindlessly deleting lines but that was it. It was very odd because I used Eclipse the day before and no issues! I didn't download anything new D: Anyway, thank you! – StephanieQ Apr 19 '17 at 14:48
  • I just removed `-vmargs` – Lorenzo Lerate Sep 03 '18 at 07:31
  • This worked for me - the KEY was using forward slashes. I was stuck using back slashes. -vm C:/Program Files/Java/jdk1.8.0_321/jre/bin/server/jvm.dll – Skystrider Mar 16 '23 at 16:13
12

it can be like this as well:

-vm 
C:\Program Files\Java\jre6\bin\server\jvm.dll
Abu Shumon
  • 1,834
  • 22
  • 36
  • 3
    This worked for me. I thought SO was just moving the C:\ part down to a second line due to size issues, but it will *only* work on a separate line. – IDontWorkAtNASA Feb 12 '15 at 19:08
  • @IDontWorkAtNASA yeah sometimes simple dot or space or newline becomes an really important issue! – Abu Shumon Feb 13 '15 at 09:45
  • I just downloaded new version of JRE 1.8 and add this line and it worked form me. – Brij Jul 12 '22 at 08:42
  • This worked for me - the KEY was using forward slashes. I was stuck using back slashes. -vm C:/Program Files/Java/jdk1.8.0_321/jre/bin/server/jvm.dll – Skystrider Mar 16 '23 at 16:13
7

Working combinations of OS, JDK and eclipse bitness.

  • 32-bit OS , 32-bit JDK , 32-bit Eclipse (32-bit only)
  • 64-bit OS , 32-bit JDK , 32-bit Eclipse
  • 64-bit OS , 64-bit JDK , 64bit Eclipse (64-bit only)

Kindly use 1 of the above combinations.

tk_
  • 16,415
  • 8
  • 80
  • 90
6

Adding -vm parameters works for me.

-vm 
C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll
Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117
6

For those of you who tried all the above answers without any success, try lowering your -Xms value. I am required to support an older Eclipse (Weblogic Eclipse 10.3.6) - I had the following .ini on my Windows 7 machine and my Windows Server 2008 R2 Enterprise VM (the Java version below points to a 32-bit Java) that had worked and were working perfectly, respectively.

-vm
C:/Java/Java7/jdk1.7.0_79/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vmargs
-Xms1024m
-Xmx1024m
-XX:MaxPermSize=256m
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dweblogic.home=C:/Oracle/Middleware/wlserver_10.3

So a 32-bit Java for a 32-bit Eclipse, but still exit code 1. Based on all answers I had seen here, and the only change being a new laptop with Windows 10, the only possible explanation was that the new OS and the Eclipse were disagreeing on something. So I started playing around with each of the values, and it worked when I lowered both Xms and Xmx to 512m. I have a hunch that possibly the new Windows OS is preventing a higher initial heap size based on some run condition (the higher -Xms does work on Windows 10 on all other similar devices I came across) - so any other explanation is welcome. Meanwhile following is the only value I tweaked to successfully launch Eclipse.

-Xms512m 
Sumiya
  • 317
  • 4
  • 5
  • If you're using a virtual machine (VM) and can't lower the -Xms value (for instance, the bat file is on a read-only shared drive), then allocate more memory to the VM. Seems obvious but I overlooked this for an hour. – Skurfur Jul 19 '17 at 03:46
5

I've encountered similar problems. The reason is that the path to my eclipse includes Chinese characters. Once those characters are deleted, the problem is solved. Please check if there are characters other than English in your path.

Bernie
  • 51
  • 1
4

I had same issue in my windows 7, 64-bit machine. Then I downloaded and installed 64 bit jdk for Java(which includes jre). This solved the issue.

CRM
  • 1,349
  • 2
  • 12
  • 28
  • Simply doing an Java update will solve this issue as well, if your Java version is outdated. – cid May 22 '16 at 02:54
3

I too faced the similar issue , not solved after adding the command in eclipse.ini file. My root cause is different. I was experimenting on sequence diagrams using objectaid. This is throwing an exception and disturbed my workspace. You may have different issue when working on new plugins. Better you check the log file located in your project work-space C:\path\to\workspace\.metadata\.log

Jajikanth pydimarla
  • 1,512
  • 13
  • 11
2

This can be resolved by adding the following line to the eclipse.ini file -XX:-UseCompressedOops

Vivek
  • 21
  • 1
  • 1
    This is a pretty short line for a parameter which only works under special circumstances. Afaik, `UseCompressedOops' is enabled by default starting with Java 6_18. In adition it is only available in Java 6 and above and it was made for 64 bit applications only. So it might help, but only with some specific Java versions. – Calon Feb 17 '14 at 12:22
2

I had the same issue which was caused due to crash shutdown of my windows 10. Earlier in the path I had Oracle path ie the path inserted by Oracle at the time of installation of JDK. I removed it and changed the path to the JDK location. This solved the problem.

Vijay
  • 213
  • 1
  • 9
2

Mine is a 64 bit system with 64bit java installation. what worked for me was the following:

  1. Goto the eclipse installation directory
  2. right click the eclipse icon and click "send to desktop as shortcut"
  3. Then right click on the shortcut icon in the desktop and then > properties > shortcut tab
  4. In the target field point it to the correct java 64 bit installations home path using the vm argument with the java_home path enclosed in quotes like so :

    D:\Scala_eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.8.0_11"

    scala eclipse shortcut icon

This almost always solves all my Eclipse (scala eclipse as well) related problems. As mentioned in the answer , please make sure you are using the right combination of eclipse and java

stormfield
  • 1,696
  • 1
  • 14
  • 26
2

If you have java 8 installed it might be related to the following issue: https://support.oracle.com/knowledge/Middleware/2412304_1.html

Simply removing/renaming the "C:\Program Files (x86)\Common Files\Oracle\Java\javapath" worked for me.

sergeyan
  • 1,173
  • 1
  • 14
  • 28
1

Directly changing eclipse file is not a good idea, no matter facet or ini, unless it could be changed in eclipse. Had the same problem, with jdk1.8 installed. Change it to jdk 1.7.enter image description here

Besides, according to https://wiki.eclipse.org/Eclipse/Installation, both LUNA and MARS need 1.7. So just ensure you have it installed.

Tiina
  • 4,285
  • 7
  • 44
  • 73
1

1 ) Open the SpringToolSuite4.ini File.
2 ) Search For the openFile.
3 ) Provide the jvm.dll file location in SpringToolSuite4.ini
4 ) Note : Provide the New Line between -vm and your jvm.dll file location path.as shown below.

openFile
-vm 
C:\Program Files\Java\jre8\bin\server\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms256m

enter image description here

Lova Chittumuri
  • 2,994
  • 1
  • 30
  • 33
  • this solved my issue. I edited -vm with c:\Program Files\Java\jdk1.8.0_211\jre\bin\server\jvm.dll Thank you Lova – tom johnes Nov 23 '19 at 18:13
1

i had Java Run time environment and Java SDK both on my machine. I removed Java Run time environment and it resolved my error. Earlier this error, i was using elipse with Java SDK only and later had installed JRE specifically for one need.

  • most probably the installation of the JRE changed the JAVA_HOME env var, which affected eclipse startup – Genry Jun 08 '21 at 12:47
0

just to add here...
For the guys those who still couldn't start eclipse due same error, please check eclipse.ini file again and see have you forgot to put M after memory size. For example:

-Xmx1024
or
-Xmx1024MB
or
-Xmx1024 M
or
-Xmx1024 mb
or
-Xmx1024mb

are incorrect, it should be -Xmx1024M. I have been trying different ideas from SOF and from other forums, and in this cut/paste I forgot that I missed M (such a little thing to miss), so I thought I should share. If it works for some of you please up-vote.

paul
  • 4,333
  • 16
  • 71
  • 144
0

I had this issue recently, but I hadn't changed any java or updated the java version, May be this issue happened because of crash shutdown of the system.

And after reading a couple of answers here I decided to change the java version from 1.6 to 1.7 in the eclipse.ini file.

-vmargs
-Dosgi.requiredJavaVersion=1.6  

After this change the Eclipse started well and it worked. Since I didnt had changed anything i decided to change it back to 1.6 to what it was originally.

Then I started eclipse and guess what it worked. So Looks like in my case just touching/modifiying the eclipse.ini file worked.

I hope this answer is helpful to somebody.

Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117
user_CC
  • 4,686
  • 3
  • 20
  • 15
0

If none of the solutions works, please check if you have more than one version of java installed on your machine. Please keep only one version which you prefer and everything should work fine.

Neo
  • 93
  • 1
  • 12
0

None of the above answers helped for me. I discovered that, in general, an error like that could mean that your eclipse.ini has an invalid entry. So, all the above answers could be correct, depending on your particular case. In my case, it turned out I added a locale argument with a typo in it.

Richard
  • 436
  • 5
  • 4
0

I tried to change the path in the parameter -vm, but it did not help. Then I deleted the parameter -vm and -vmargs from the eclipse.ini. It worked for me

Koss
  • 1,012
  • 11
  • 8
0

Please check your computer and if Java JRE not install download and install it.

If install please check is it 32 bit or 64 bit as per your operating system

To check for 32 or 64-bit JVM, run:

$ java -d64 -version

$ java -d32 -version

Error: This Java instance does not support a X-bit JVM. Please install the desired version.

vaquar khan
  • 10,864
  • 5
  • 72
  • 96
0

My path of -javaagent argument was having Spacial characters like '&'. I placed the Lambok jar in different place and gave the path to that place. It worked for me.

previously it was

-javaagent:C:\Software & Tool\lambok.jar

i changed it to

-javaagent:C:\Labmok\lambok.jar

shreyansh pandey
  • 344
  • 2
  • 13
0
  1. Open the Eclipse Installation Folder on Windows Machine

  2. Find the eclipse.ini

  3. Open the eclipse.ini File and add the below two lines before -vmargs

    -vm 
    C:\Users\IshaqKhan\jdk1.8.0_173\bin\javaw.exe
    
Ishaq Khan
  • 929
  • 9
  • 7
0

This work for me in eclipse js and eclipse php:

 -vm
 C:/java/jdk-11.0.1/bin/javaw.exe
 --launcher.appendVmargs
 -vmargs
And
  • 73
  • 2
  • 7
0

I had a similar issue. I opened my eclipse.ini file and noticed that I configured at the end some lines for the lombok library in the past. The path to my lombok jar file was no more valid. After correcting it, my eclipse was working like a charm again. In conclusion, my piece of advice would be to verify that all the paths configured in this file are valid.

eclipse.ini :

-...
-javaagent:C:\some\path\to\lombok.jar
-Xbootclasspath/a:C:\some\path\to\lombok.jar
TranceVibes
  • 126
  • 2
  • 8
0

JAVA Path could be incorrect

Trying above solution didn't help me. So i checked java --version on command prompt, which gave virtualization conflict. It seemed installation of virtualization software on system had messed up environment variables.

Hence I checked JAVA_HOME which was on correct path, then checked system variable PATH which had correct JAVA bin path as well, so removed 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath' and checked java --version on command prompt again, which gave correct value and also fixed above issue of eclipse start.

priyanka_rao
  • 465
  • 1
  • 4
  • 20
0

On Windows 10, removing

-XstartOnFirstThread

from the eclipse.ini fixed the issue for me

robwill
  • 81
  • 1
  • 4
0

Go to eclipse folder and then go Configuration Setting file

change the below path under -vm tag in config file Note- you need to mention new java path with bin and then javaw.exe like below

-vm java path/bin/javaw.exe

It should work. Thanks.

Ashish Gupta
  • 105
  • 1
  • 5
-4

if it says c:/program files/java/jre/bin/server/jvm.dll not found then copy the jre from jdk folder and paste it outside the jdk folder . and then try again...

  • This is not neccessary and I can't figure out, how this should help. There might be other programs accessing that jre, which won't find it anymore afterwards. – Calon Jul 18 '14 at 04:55