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

转载自:https://blog.csdn.net/gnail_oug/article/details/51925804;个人做了些小修改。

今天下载了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以上,如下图:

9fee6be5e2a63616316265bb9013578e.png

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

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

-startup

plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444

-product

org.eclipse.epp.package.jee.product

--launcher.defaultAction

openFile

-showsplash

org.eclipse.platform

--launcher.defaultAction

openFile

--launcher.appendVmargs

-vmargs

-Dosgi.requiredJavaVersion=1.8

-XX:+UseG1GC

-XX:+UseStringDeduplication

-Dosgi.requiredJavaVersion=1.8

-Xms256m

-Xmx1024m

在 -vmargs 上一行--launcher.appendVmargs的上一行增加 -vm参数来指定jdk路径,如我的jdk路径在d:\java文件夹下 :

-vm

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

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

-startup

plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444

-product

org.eclipse.epp.package.jee.product

--launcher.defaultAction

openFile

-showsplash

org.eclipse.platform

--launcher.defaultAction

openFile

-vm

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

--launcher.appendVmargs

-vmargs

-Dosgi.requiredJavaVersion=1.8

-XX:+UseG1GC

-XX:+UseStringDeduplication

-Dosgi.requiredJavaVersion=1.8

-Xms256m

-Xmx1024m

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值