JDK8 - 类型 java.util.Map$Entry 无法解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23825048/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:25:09  来源:igfitidea点击:

JDK8 - The type java.util.Map$Entry cannot be resolved

javajava-8

提问by Ankit Sharma

I am using java.util.TreeSetClass in my project. It compiles perfectly with JDK7, but when i am using JDK8 to compile the program. It is showing compile time error.

java.util.TreeSet在我的项目中使用Class。它与JDK7完美编译,但是当我使用JDK8编译程序时。它显示编译时错误。

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

Is it some encoding issue or something else? how can i resolve this?

是编码问题还是其他问题?我该如何解决这个问题?

采纳答案by Ankit Sharma

I have updated my glassfish application server and it has been solved my problem.

我已经更新了我的 glassfish 应用程序服务器,它已经解决了我的问题。

回答by Sky

I've met this using Tomcat 7.0. I solved it by upgrading Tomcat to 8.0 or replacing the ect.jar to the latest one.

我使用 Tomcat 7.0 遇到过这个问题。我通过将 Tomcat 升级到 8.0 或将 ect.jar 替换为最新的来解决它。

回答by Sandra

@Sky provided the only suggestion that worked for me - in tomcat/lib replace ecj-x.jar with the newer version.

@Sky 提供了唯一对我有用的建议 - 在 tomcat/lib 中用较新的版本替换 ecj-x.jar。