eclipse installed but cannot start java returned e

2019-04-10 06:46发布

问题:

I recently installed eclipse-dsl-juno-SR1-win32-x86_64 and after extracting the files, as I started running Eclipse it gave me the following error :

Java was started but returned exit code=1 (required java version=1.5)

I checked the reason for this and also tried reinstalling as well as solutions suggested by other discussion forums, but to no avail.

I have installed

  • Eclipse IDE for Java and DSL Developers : eclipse-dsl-juno-SR1-win32-x86_64 under the Eclipse Juno SR1 packages AND
  • JDK 1.7.0_11 (x64)

I have linked my Environment Variables up correctly and tried to compile a Java file through cmd and have succeeded.

I tried running the following in cmd: -vm "mypath\jdk1.7.0_11\jre\bin" command as forums suggested

as well as other paths -vm "mypath\jdk1.7.0_11\bin" -vm "mypath\jdk1.7.0_11\jre\bin\javaw.exe" even -vm "mypath\jre6\bin" out of desperation to no avail.

Please help me out with this. I'm stuck :(

回答1:

What worked for me was to set -vm to point to jvm.dll instead of java.exe or javaw.exe

-vm C:your_java\jre7\bin\client\jvm.dll

It seems a bug with Java 1.7. If you go back to Java 1.6 the problem seems to disappear as well.

Eclipse: Java was started but returned exit code -1073741571



回答2:

Sorry - a bit too much for a comment - my suggestion:

First of all: I've just tried it with - well - almost the configuration you have (Win8-64bit), but with already a newer java and the SR2 release of Eclipse-DSL. No issues. But I don't think the previous release could be the issue here, but if nothing helps: try downloading the SR2-release.

I know it's all stated in your post, but really make sure you're starting your 64-Bit eclipse with a 64-bit java. Also you always have to provide one of the java.exe, javaw.exe or jvm.dll in the vm-argument, if you provide the vm-argument - not just the java directory.

Also try the following: start with

-vm "<yourjavainstallation>\bin\java.exe" -consoleLog -debug

mind: it is java.exe, not javaw.exe - a console (command window) will appear - maybe the messages will help?

If all fails - try to do it with a 32-bit java and 32-bit eclipse installation. You can use the newest java - JDK 1.6 is not needed. One last point: the required java version=1.5) suggests you have an ancient JDK on your system (if the error message is correct that is). If you still have a JDK 1.4 and older on your system - try to deinstall it, if you really do not need it any more (I wouldn't find a reason what for actually).

One last thing: There is a way to make sure eclipse uses a specified jre without the vm-argument. You can actually copy the needed jre to your eclipse-installation in a sub-folder called "jre" resulting in the following structure:

eclipse
    eclipse.exe
    jre
       bin
          java.exe
          ...
       lib
          ...

and start the eclipse without the vm-argument. I hope one of the points will help!



回答3:

I have added following lines in eclipse.ini file after openFile.

-vm

C:/Progra~2/Java/jdk1.6.0_27/jre/bin/javaw.exe

Now its working fine.



回答4:

It seems that there is a bug happens with JDK 1.7.0_11 (x64). the Solution is in this https://stackoverflow.com/a/14022587/2294985 , Illustrating what to change in the eclipse.ini file



回答5:

I started getting same error for eclipse after installing QTP on my laptop.

when I tried to run a simple java hello world program from command prompt , I got below error :

c:\Java\test>javac MyFirstApp.java
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar;C:\Users\vivekrs\Documents\Raj\sev2\Tools\
QTP11\QuickTest\MSI\bin\java_shared\bin
Error occurred during initialization of VM
Could not find agent library jvmhook on the library path, with error: %1 is not a valid Win32 application

Then I removed JAVA_TOOL_OPTIONS and _JAVA_OPTIONS variables from Environments and java and Eclipse both started working fine.

you can try type javac in cmd prompt and see what error you are getting, and try to resolve that error, elipse will start working.



回答6:

I have removed this line and works for me in Eclipse Luna:

-XX:-UseCompressedOops
-vm
C:\Program Files\Java\jdk1.7.0_79\jre\bin\server\jvm.dll


回答7:

I added the line: -XX:-UseCompressedOops

to eclipse.ini and so far so good!