如何在eclipse的配置文件里指定jdk路径

来源:互联网 发布:linux进入命令模式 编辑:程序博客网 时间:2024/04/30 09:15

今天下载了eclipse4.6版本,打开时报Version 1.7.0_45 of the JVM is not suitable for this product. Version:1.8 or greater is required.,提示jdk版本要1.8以上,如下图:



由于不想直接将环境变量配置的jdk1.7改为jdk1.8,所以单独在eclipse的配置文件里指定jdk来运行eclipse4.6,方法如下:

打开eclipse根目录下的eclipse.ini配置文件,eclipse4.6默认配置如下:

-startupplugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile-showsplashorg.eclipse.platform--launcher.defaultActionopenFile--launcher.appendVmargs-vmargs-Dosgi.requiredJavaVersion=1.8-XX:+UseG1GC-XX:+UseStringDeduplication-Dosgi.requiredJavaVersion=1.8-Xms256m-Xmx1024m

在 -vmargs 前面增加 -vm参数来指定jdk路径,如我的jdk路径在d:\java文件夹下 :

-vm
D:\java\jdk1.8.0_91\bin\javaw.exe

添加 -vm参数后的配置文件如下:

-startupplugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile-showsplashorg.eclipse.platform--launcher.defaultActionopenFile--launcher.appendVmargs-vmD:\java\jdk1.8.0_91\bin\javaw.exe-vmargs-Dosgi.requiredJavaVersion=1.8-XX:+UseG1GC-XX:+UseStringDeduplication-Dosgi.requiredJavaVersion=1.8-Xms256m-Xmx1024m

然后再次运行eclipse.exe便能正常启动了。








3 0
原创粉丝点击