JDK8之The type java.util.Map$Entry cannot be resolved
时间:2021-10-19 00:22:33
JDK8发布以及多日了,今天,想体验一下,安装之后,试着导入原来的一个Project,结果报出两个红叉:
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
很不理解,原来好好的一个项目怎么就报错了呢,网上搜了一下也没找到解决方法,无奈,只有退回原来的JDK7,然后一切都恢复正常了,很是不解!于是贴出来让遇到同样问题的朋友迅速知道是怎么回事,也请知道这个问题原因的朋友不吝指教,帮忙解惑,感激不尽!
47 个解决方案
#1
是用的Eclipse吗?
网上给出的解决办法是:
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.
我也碰到你这个问题了:
我是在做2维码的时候碰到这个问题了
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
是因为eclipse 对1.8的不支持所致,最起码我的是这样
然后我去eclipse 官网去查看,发现eclipse直到4.3.2 版本才完全对jdk1.8支持,引用:contain full support for Java™ 8. For Kepler SR2 (4.3.2)
请到 官网查看 http://download.eclipse.org/eclipse/downloads/
看看能不能解决你的问题
#18
我也是这个问题,把jre8改为jre7就好了,你也可以试试
#19
#20
环境换成1.6的就没什么问题了啊
#21
环境换成1.6的就没什么问题了啊,但是怎么才能用1.8呢
#22
遇到同样问题,改成1.5就好了
#23
我也遇到这个问题,原来是jdk8的问题,换回MyEclipse自带的jre1.6就好了
#24
十二月 31, 2014 9:19:44 上午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_25/bin/client;C:/Program Files/Java/jre1.8.0_25/bin;C:/Program Files/Java/jre1.8.0_25/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\NetSarang;E:\app\lihong_tang\product\11.2.0\dbhome_1\bin;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;D:\TortoiseSVN\bin;D:\Java\jdk1.6.0_11\bin;C:\Program Files\Windows Live\Shared;F:\tools\apache-maven-3.2.3-bin\apache-maven-3.2.3\bin;C:\Program Files\AMD\ATI.ACE\Core-Static;F:\tools\eclipse3.7indigo靛青版\eclipse;;.
十二月 31, 2014 9:19:45 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Exam' did not find a matching property.
十二月 31, 2014 9:19:45 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8111"]
十二月 31, 2014 9:19:45 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8119"]
十二月 31, 2014 9:19:45 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 753 ms
十二月 31, 2014 9:19:45 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十二月 31, 2014 9:19:45 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.40
十二月 31, 2014 9:19:46 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [395] milliseconds.
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-bean is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-html is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-logic is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-nested is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-tiles is already defined
十二月 31, 2014 9:19:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8111"]
十二月 31, 2014 9:19:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8119"]
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2163 ms
十二月 31, 2014 9:20:03 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [action] in context with path [/Exam] threw exception [Servlet execution threw an exception] with root cause
java.lang.Error: Unresolved compilation problem:
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
网上给出的解决办法是:
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.
我也碰到你这个问题了:
我是在做2维码的时候碰到这个问题了
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
是因为eclipse 对1.8的不支持所致,最起码我的是这样
然后我去eclipse 官网去查看,发现eclipse直到4.3.2 版本才完全对jdk1.8支持,引用:contain full support for Java™ 8. For Kepler SR2 (4.3.2)
请到 官网查看 http://download.eclipse.org/eclipse/downloads/
看看能不能解决你的问题
#18
我也是这个问题,把jre8改为jre7就好了,你也可以试试
#19
发现1.8的文件放的位置跟1.7的不一样,在重新配置下环境变量
发现1.8的文件放的位置跟1.7的不一样,在重新配置下环境变量就好了
怎么配置啊
#20
环境换成1.6的就没什么问题了啊
#21
环境换成1.6的就没什么问题了啊,但是怎么才能用1.8呢
#22
遇到同样问题,改成1.5就好了
#23
我也遇到这个问题,原来是jdk8的问题,换回MyEclipse自带的jre1.6就好了
#24
十二月 31, 2014 9:19:44 上午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_25/bin/client;C:/Program Files/Java/jre1.8.0_25/bin;C:/Program Files/Java/jre1.8.0_25/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\NetSarang;E:\app\lihong_tang\product\11.2.0\dbhome_1\bin;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;D:\TortoiseSVN\bin;D:\Java\jdk1.6.0_11\bin;C:\Program Files\Windows Live\Shared;F:\tools\apache-maven-3.2.3-bin\apache-maven-3.2.3\bin;C:\Program Files\AMD\ATI.ACE\Core-Static;F:\tools\eclipse3.7indigo靛青版\eclipse;;.
十二月 31, 2014 9:19:45 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Exam' did not find a matching property.
十二月 31, 2014 9:19:45 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8111"]
十二月 31, 2014 9:19:45 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8119"]
十二月 31, 2014 9:19:45 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 753 ms
十二月 31, 2014 9:19:45 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十二月 31, 2014 9:19:45 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.40
十二月 31, 2014 9:19:46 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [395] milliseconds.
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-bean is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-html is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-logic is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-nested is already defined
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://struts.apache.org/tags-tiles is already defined
十二月 31, 2014 9:19:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8111"]
十二月 31, 2014 9:19:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8119"]
十二月 31, 2014 9:19:47 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2163 ms
十二月 31, 2014 9:20:03 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [action] in context with path [/Exam] threw exception [Servlet execution threw an exception] with root cause
java.lang.Error: Unresolved compilation problem:
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files