The type java.util.Map$Entry cannot be resolved问题的解决

本文是转载文章,文章的来源:csdn博客
博主:
niaonao
文章:The type java.util.Map$Entry cannot be resolved问题的解决
博文地址:
https://blog.csdn.net/niaonao/article/details/76159172

 

开门见山(这是一首歌)

一、异常信息

我这里遇到的异常信息详细如下:

HTTP Status 500 - Unable to compile class for JSP:
 
type Exception report
 
message Unable to compile class for JSP:
 
description The server encountered an internal error that prevented it from fulfilling this request.
 
exception
 
org.apache.jasper.JasperException: Unable to compile class for JSP: 
 
An error occurred at line: [1] in the generated java file: [D:\yonyounc\work\server\bright\localhost\_\org\apache\jsp\admin_jsp.java]
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
 
Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	sun.reflect.GeneratedMethodAccessor535.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:483)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:277)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:1)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:309)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:169)
	java.security.AccessController.doPrivileged(Native Method)
	nc.bs.framework.server.LoggerServletFilter.doFilter(LoggerServletFilter.java:35)
	sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:483)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:277)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:1)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:309)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:249)
note The full stack trace of the root cause is available in the UAP Server logs.
 

二、异常处理

2.1说明

    异常出现时本地配置JDK版本为JDK8,java version "1.8.0_20"。

2.2问题解决

    JDK版本问题。把JDK8换成JDK7即可。(备注:如果不行,可以换成jdk6试试)

2.3其他解决方案

    1)JDK换成低版本JDK8-JDK6【jdk换成低版本】

    2)Tomcat版本换成Tomcat8【tomcat或成高版本】

    3)更新开发工具【eg:Myeclipse10升级为Myeclipse2014或者更高】

2.4问题解释

    1)使用的开发工具对JDK8还不完全支持

    2)编译版本和运行版本不一致

    3)老版本的eclipse不兼容JDK8

   4)It means: "A class that you use needs an other class that is not on the classpath." You should make sure to add the required jar to the classpath.

 

另外参考:

备注:【问题+解决方案 来源:https://blog.csdn.net/qq_17864929/article/details/47414743

问题:解决jdk8之The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .

之前在myeclipse10上配置jdk1.8,就报这个错误:

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

解决方案:

        换成1.7就好了,后来我换1.8jdk新建一个工程,写了一个action类继承ActionSupport还是报错,有此判定,肯定不是编译的问题了,之前也clean多次。

异常原因:是因为myeclipse10不支持jdk1.8导致,换成最新的myeclipse或者eclipse,然后配置jdk1.8,问题得到解决

你可能感兴趣的:(java编程环境配置+问题总结)