The type java.util.Map$Entry cannot be resolved. 问题解决
来源:互联网 发布:网络通信 教学反思 编辑:程序博客网 时间:2024/06/05 15:39
今天使用Eclipse搭建SpringMVC环境的时候,遇到一个Error:
An error occurred at line: 1 in the generated java fileThe type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class filesStacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
本地环境:
java version “1.8.0_45”
apache-tomcat-6.0.35
Eclipse Java EE IDE for Web Developers. Version: Luna Service Release 2 (4.4.2)
解决办法:
国内网站简单查了下,全说降低JDK版本。没明白根本原因,然后在StackOverFlow找到解答。下面是链接。
StackOverFlow
里面这么说:
When using JDK 8 and an IDE with its own compiler, like Eclipse, you have to update the IDE to a version with Java 8 support, even if you are not using the newer Java 8 features.
The reason is that the [应该是指Eclipse] compiler must be able to load the newer class files of the JRE(应该是指JRE8) in order to compile your software which references these classes.
Sometimes you can get away with an older compiler when it ignores the newer version number of the class files. But some types will confuse older class file parsers as they use new features, notably(尤其是) AnnotatedElement, which now has default methods, and Map.Entry, an interface which now has static methods.
It seems that Eclipse does not make a difference between references for which no class file could be found and class files it failed to read when saying “«classname» cannot be resolved”.
可以看出,出问题的不是JRE/JDK什么的,是IDE的问题。
本地解决办法:
降级到JDK7,加入rt.jar到/WebContent/WEB-INF/lib下。
- The type java.util.Map$Entry cannot be resolved. 问题解决
- The type java.util.Map$Entry cannot be resolved.
- JDK8 - The type java.util.Map$Entry cannot be resolved
- The type java.util.Map$Entry cannot be resolved.
- 在MyEclipse中消除The type java.util.Map$Entry cannot be resolved
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced问题
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class
- SSH之JDK1.8遇错The type java.util.Map$Entry cannot be resolved.
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced
- JDK 8 - “The type java.util.Map$Entry cannot be resolved”
- Myeclipse调错:The type java.util.Map$Entry cannot be resolved.
- 在MyEclipse中消除The type java.util.Map$Entry cannot be resolved
- The type java.util.Map$Entry cannot be resolved问题的解决
- the type java.util.Map$Entry cannnot be resolved 解决办法
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- 解决jdk8之The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- 【java学习之旅】——JSTL+EL表达式让jsp页面简洁化
- java assert关键字
- 希腊字母简表
- bitmap的一些工具
- .git 文件夹详解
- The type java.util.Map$Entry cannot be resolved. 问题解决
- 四大组件之Service
- linux shell(别名与快捷键)
- 项目管理----项目进度管理
- java实现定时任务
- 使用npm安装vue脚手架cli或者angular-cli时出错的解决方法
- 机器学习算法集锦:从贝叶斯到深度学习及各自优缺点
- 一个java高级工程师的进阶之路【转】
- RxJava 从入门到爱上它