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