简体   繁体   English

安装了多个java版本并启动了java但返回了退出代码= 13

[英]Multiple java versions installed and java was started but returned exit code=13

I am not able to start eclipse on Windows 7. It was working fine yesterday. 我无法在Windows 7上启动eclipse。昨天工作正常。 Here is the screenshot of error when I start eclipse: 这是我开始日食时的错误截图:

我开始日食时出现Eclipse错误

Java versions from CMD 来自CMD的 Java版本

java和javac版本

Why it gives different versions for java and javac ? 为什么它为javajavac提供不同的版本?

My java home is set to Jdk 7 as below: 我的java home设置为Jdk 7,如下所示:

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. 注意:我的机器上安装了jdk 8,但是我没有设置jdk 8路径。

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. 这个问题已被问过几次,但我无法在我的机器上解决它,所以请不要将其标记为重复。

In the environment variables check your path whether it is starts with C:\\ProgramData\\Oracle\\Java\\javapath 在环境变量中检查您的路径是否以C:\\ProgramData\\Oracle\\Java\\javapath

if yes then please remove it and try again 如果是,那么请删除它,然后再试一次

More than likely you've installed JDK 1.70_60 prior to installing JRE 1.8.0_51 . 在安装JRE 1.8.0_51之前,您很可能已安装JDK 1.70_60 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). 这意味着您的编译器javac可以在JDK发行版(Java Development Kit)中找到,并且您的java运行时可以在最近下载的JRE(Java运行时环境)中找到。 JRE does not contain the javac (Java compiler). JRE不包含javac (Java编译器)。

我最近面临同样的问题,Java 8安装程序前置于Windows PATH变量C:\\ProgramData\\Oracle\\Java\\javapath ,这就是为什么你会看到javajavac不同版本

Your eclipse might not be pointing to the right JDK. 你的日食可能没有指向正确的JDK。

Open your eclipse.ini configuration file for editing. 打开eclipse.ini配置文件进行编辑。 This can be found in the same folder with eclipse.exe file. 这可以在与eclipse.exe文件相同的文件夹中找到。

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. 然后,重启eclipse。

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 我最近安装了jdk 8. Java 8安装程序前置于Windows PATH变量C:\\ProgramData\\Oracle\\Java\\javapath ,这就是我看到javajavac不同版本的原因

For those who runs on the same issues, I have found nice explanation here 对于那些遇到同样问题的人,我在这里找到了很好的解释

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM