Eclipse启动时报错Java was started but returned exit code=13

时间:2022-02-22 12:20:39

Eclipse启动时报错Java was started but returned exit code=13

如图所示

Eclipse启动时报错Java was started but returned exit code=13

原因是通过第三方更新JRE时,第三方安装的是32位的JRE,与64位的eclipse不匹配(报错信息的--launcher.library中有x86_64说明这个eclipse是64位的)

JDK8/JRE8在安装完成之后,会添加一个环境变量C:\ProgramData\Oracle\Java\javapath

这个环境变量是三个快捷方式,分别是java.exe.lnk javaw.exe.lnk javaws.exe.lnk,你每安装一次JDK/JRE,这三个快捷方式都会更新路径为最后一次的JRE路径
Eclipse启动时报错Java was started but returned exit code=13

原因找到了,重新安装一遍64位的JDK解决问题

附1:32位64位运行java -version命令对比

32位

Eclipse启动时报错Java was started but returned exit code=13

C:\>java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

  64位

Eclipse启动时报错Java was started but returned exit code=13

C:\>java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

 可以看到64为的有64-Bit字样,32位的没有 

附2:通过eclipse目录特定文件判断eclipse是32位还是64位

eclipse32位和64位的目录结构是差不多的,我们可以解压后查看eclipse.ini文件,通过对比-launcher.library查找有没有x86_64字样,有说明是64位,反之就是32位

如图,上面的是32位,下面的是64位
Eclipse启动时报错Java was started but returned exit code=13

eclipse目录结构

Eclipse启动时报错Java was started but returned exit code=13