On starting eclipse, it gives an error “Java was s

2019-09-04 23:38发布

I am trying to start eclipse after installing java 7 and adding the line

-vm
C:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe

to the eclipse.ini file. Still i am getting the error "Java was started but returned exit code=13". enter image description here

I just want to know how to start eclipse. Even if i have to install eclipse, java, jre all over again. Any suggestion will do!

My eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-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:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

On pasting the jre in eclipse folder i am getting this error:

enter image description here

3条回答
兄弟一词,经得起流年.
2楼-- · 2019-09-05 00:24

Check eclipse.ini file, and in particular format of the vm option (look here for more):

Note the format of the -vm option - it is important to be exact:

  • The -vm option and its value (the path) must be on separate lines.
  • The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
  • The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.

Another thing to check is that bit version (32/64) of JVM should match bit version of eclipse (32/64).

查看更多
萌系小妹纸
3楼-- · 2019-09-05 00:40

All you have to do is to put the new jdk path in eclipse.ini

-vm
C:\Program Files\Java\jdk1.8.0_11\bin\javaw.exe
or the your new jdk path.
make sure that you type the above just before the -vmargs and after the OpenFile

that solved my problem

查看更多
乱世女痞
4楼-- · 2019-09-05 00:40

Check that you have installed the correct java that your OS requires. Meaning, if you are running a 64 bit OS then you need 64 bit java and the same for 32 bit.

查看更多
登录 后发表回答