参考转自:http://blog.csdn.net/fighterandknight/article/details/54727987
运行eclipse时报如下错误:
错误一:

错误二:
a java runtime environment(JRE) or java development kit(JDK) must be....

在eclipse的配置文件里指定jdk路径,只需在eclipse的配置文件里增加-vm参数即可。
打开eclipse目录下的eclipse.ini配置文件,增加-vm配置,需要注意的是该参数要加在-vmargs之前
eclipse.ini配置文件:
-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
D:/Program Files/Java/jdk1.8.0_121/jre/bin/server/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
本文详细介绍了如何解决在运行Eclipse时遇到的JRE或JDK未找到的问题。通过在eclipse.ini配置文件中正确指定JDK路径,可以避免此类错误。文章提供了具体的配置示例,包括-vm参数的使用,以及如何确保该参数位于-vmargs之前。
292

被折叠的 条评论
为什么被折叠?



