java.util.Arrays不工作java 8 [英] java.util.Arrays not working java 8

查看:124
本文介绍了java.util.Arrays不工作java 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了在我的电脑上使用Java 8进行eclipse。我以前一直在使用Java 7.起初,更新似乎工作正常,因为我可以编译并运行一个简单的 hello world 程序。但是,当我开始导入以前使用过的项目时,我使用了类 java.util.Arrays ,我得到一个错误,如数组无法解决。我有一个类似的问题,与 PriorityQueue 类说,


键入 java.util.Comparator 无法解析。它是从必需的 .class 文件间接引用的。



解决方案

我今天遇到了类似的事情。不知道是否同样的问题,但我所做的是:



打开项目资源管理器



右键单击项目



查找配置构建路径



imgur.com/o7EAT.pngalt =enter image description here>



向下滚动到JRE系统库(我的旁边有一个红色的错误符号)和点击图书馆。





在右上角选择编辑按钮



选择替代JRE,然后选择(在您的情况下)java 8


I recently updated to using Java 8 on my computer for eclipse. I had previously been using Java 7. At first the update seemed to work fine as I could compile and run a simple hello world-program. However, as I began to import previous projects that I had been working on that used the class java.util.Arrays, I got an error like Arrays could not be resolved. I have been having a similar problem with the PriorityQueue class saying that,

The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files.

解决方案

I ran into something really similar today. Not sure if its the same issue, but what I did was:

Open project explorer

Right click the project

Find "Configure Build Path"

In the window that opens, select the "Libraries" tab

Scroll down to JRE System Library (there was a red error symbol next to mine) and click the library.

In the top right, select the Edit button

Choose "Alternate JRE" and then pick (in your case) java 8

这篇关于java.util.Arrays不工作java 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆