更改 Eclipse 运行的 Java 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13176890/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change the Java version Eclipse is running under
提问by Matthias
I want to run my Eclipse in a newer Java version (jdk 1.7) because of compatibility problems with the Window Builder Plugin
由于 Window Builder 插件的兼容性问题,我想在较新的 Java 版本 (jdk 1.7) 中运行我的 Eclipse
"Eclipse is running under 1.6, but this Java project has a 1.7 Java compliance level, so will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version."
“Eclipse 在 1.6 下运行,但此 Java 项目具有 1.7 Java 合规性级别,因此将无法从该项目加载类。为项目使用较低级别的 Java,或使用较新的 Java 版本运行 Eclipse。”
So I suppose, I've to change the vm of Eclipse in the configurations.
所以我想,我必须在配置中更改 Eclipse 的 vm。
-vm
C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.home.location=file:/C:/Program Files (x86)/Eclipse IDE for Java EE Developers/
eclipse.launcher=C:\Program Files (x86)\Eclipse IDE for Java EE Developers\eclipse.exe
eclipse.launcher.name=Eclipse
[email protected]/../p2/
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
eclipse.startTime=1351770082498
eclipse.vm=C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
But I'm not realy familiar with all the statements, and my question is which ones do I've to change in order to run Eclipse with jdk 1.7?
但是我并不是很熟悉所有的语句,我的问题是我必须更改哪些语句才能使用 jdk 1.7 运行 Eclipse?
采纳答案by Ajay George
Edit the eclipse.ini
file to point -vm
to JDK 7
编辑eclipse.ini
文件,以点-vm
到JDK 7