java 錯誤:The type java.util.Comparator cannot be resolved. It is indirectly referenced from required

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

1、錯誤描述:

源項目編譯環境爲jdk1.7

後來換成了jdk1.8

Myeclipse編譯器報錯:Java the type java.util.comparator cannot resolved it is indirectly referenced from required .class  files

出錯位置爲PriorityQueue<Point> queue =new PriorityQueue<Point>();

提示錯誤爲:Java the type java.util.comparator cannot resolved it is indirectly referenced from required .class 

2、解決方法:

右鍵項目-》build path-》configure build  -》Libraries-》add Library-》添加新的jre(不是jdk,是jre)

本人默認配置的jre6版本的,更換成了jre7,成功解決該錯誤;

3、參考鏈接:

https://stackoverflow.com/questions/31956269/the-type-java-util-comparator-cannot-be-resolved

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章