5

I am not able to start eclipse on Windows 7. It was working fine yesterday. Here is the screenshot of error when I start eclipse:

Eclipse error when I start eclipse

Java versions from CMD

java and javac versions

Why it gives different versions for java and javac?

My java home is set to Jdk 7 as below:

JAVA_HOME = C:\Program Files\Java\jdk1.7.0_60

Note: I have jdk 8 installed on my machine but I have not set jdk 8 path.

This question has been asked couple of times but I am not able to resolve it on my machine so please do not mark it as duplicate.

Nitesh Virani
  • 1,570
  • 4
  • 22
  • 40
  • Do you have a java 8 JDK? or just JRE? Since the compiler is 7. Probably Windows have set the Java 8 in %PATH%, which is loaded before %JAVA_HOME%... `which java` in cmd – Danielson Aug 07 '15 at 09:32
  • @Danielson I have java 8 JDK, and my `%PATH%` has `C:\ProgramData\Oracle\Java\javapath;%JAVA_HOME%\bin;` – Nitesh Virani Aug 07 '15 at 09:36
  • Check whether you have 7 in your `environment variables`. Or, just uninstall Java 7 from your computer. java 8 can also compile to Java 7... – Danielson Aug 07 '15 at 09:39
  • possible duplicate of [Cannot run Eclipse; JVM terminated. Exit code=13](http://stackoverflow.com/questions/4945178/cannot-run-eclipse-jvm-terminated-exit-code-13) – Vedant Kekan Aug 07 '15 at 09:42

5 Answers5

8

In the environment variables check your path whether it is starts with C:\ProgramData\Oracle\Java\javapath

if yes then please remove it and try again

Sasikumar Murugesan
  • 4,056
  • 9
  • 47
  • 70
3

More than likely you've installed JDK 1.70_60 prior to installing JRE 1.8.0_51.

This would mean that your compiler javac is found within the JDK distribution (Java Development Kit) and your java runtime is found within the more recently downloaded JRE (Java Runtime Environment). JRE does not contain the javac (Java compiler).

insidesin
  • 727
  • 1
  • 7
  • 25
2

I was recently facing the same issue, Java 8 installer prepends to the Windows PATH variable C:\ProgramData\Oracle\Java\javapath that is why you are seeing different versions for java and javac

Vini Soni
  • 51
  • 8
1

Your eclipse might not be pointing to the right JDK.

Open your eclipse.ini configuration file for editing. This can be found in the same folder with eclipse.exe file.

replace:

-vm C:\ProgramData\Oracle\Java\javapath\javaw.exe

with:

-vm
C:/Program Files/Java/jdk1.7.0_60/bin/javaw.exe

Then, restart eclipse.

owenrb
  • 515
  • 2
  • 7
  • Could be but `java -version` says 7. So Windows is configured wrong – Danielson Aug 07 '15 at 09:38
  • 2
    The `-vm` parameter overrides your windows environment variable. – owenrb Aug 07 '15 at 09:39
  • or you can try to remove the entire `-vm C:\ProgramData\Oracle\Java\javapath\javaw.exe` line. The eclipse should use the JAVA_HOME variable on its next restart. – owenrb Aug 07 '15 at 09:45
0

I have recently installed jdk 8. Java 8 installer prepends to the Windows PATH variable C:\ProgramData\Oracle\Java\javapath and this is the reason I was seeing different versions for java and javac

For those who runs on the same issues, I have found nice explanation here

Nitesh Virani
  • 1,570
  • 4
  • 22
  • 40