Java 如何使用 JRE 8 设置日食?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23150755/
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
How to set eclipse with JRE 8?
提问by
I tried to update my jre version in eclipse, I added the jre 8 to my installed JRE's an checked him. When I click OK it gives me an ERROR:
我试图在 Eclipse 中更新我的 jre 版本,我将 jre 8 添加到我安装的 JRE 中并检查了他。当我单击确定时,它给了我一个错误:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from
required .class files
It happens only when I am trying to use JRE 8.
它仅在我尝试使用 JRE 8 时发生。
Someone know how to fix this?
有人知道如何解决这个问题吗?
I use Indigo Eclipse. Version: Service Release 2.
我使用靛蓝 Eclipse。版本:服务版本 2。
采纳答案by Simone
Create new workspace. Create new java project and select jvm8 as jvm. Changing the vm in an existing project is quite difficult and cached class file compiled with the previous vm can generate some strange unpredictable behavior
创建新工作区。创建新的java项目并选择jvm8作为jvm。更改现有项目中的 vm 非常困难,使用先前 vm 编译的缓存类文件可能会产生一些奇怪的不可预测的行为
回答by Simulant
You need Eclipse Kepler (4.3) Service Release 2. After startup you need to install a patch that enables using Java 8 in eclipse from this update site (Help -> install new Software... -> use site):
您需要 Eclipse Kepler (4.3) Service Release 2。启动后,您需要安装一个补丁,以便在 Eclipse 中使用 Java 8 从此更新站点(帮助 -> 安装新软件... -> 使用站点):
http://download.eclipse.org/eclipse/updates/4.3-P-builds/
But a Android Project will not benefit from Java 8 because it still uses Java 6 and you cannot use Lambda Expressions or even the diamond Operator from Java 7.
但是 Android 项目不会从 Java 8 中受益,因为它仍然使用 Java 6,您不能使用 Lambda 表达式,甚至不能使用 Java 7 中的菱形运算符。
回答by user3573186
The problem is rt.jar in the JVM 8.0.
问题是 JVM 8.0 中的 rt.jar。
java.lang.CharSequence is a class under rt.jar. rt.jar under JVM 7.0 has no problem, but rt.jar under JVM 8.0 has a problem with Eclipse Indigo. Solition is downloading Eclipse Kepler, JVM 8.0 with Kepler has no problem.
java.lang.CharSequence 是 rt.jar 下的一个类。JVM 7.0下的rt.jar没有问题,但是JVM 8.0下的rt.jar在Eclipse Indigo下有问题。Solition正在下载Eclipse Kepler,JVM 8.0 用Kepler 没有问题。