tomcat 8 支持 jdk1.8 么 运行会报下面的错误

caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [/Users/eleme/Documents/ele.me/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/coffee-eve-svr/WEB-INF/classes/me/ele/coffee/eve/webapi/base/AuthController.class]; nested exception is java.lang.IllegalArgumentException
    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:257)

求大家帮忙看看 是不是由于tomcat8不支持jdk1.8的问题啊 谢谢 大家

阅读 16.7k
4 个回答

你应该用的是spring3吧,spring3跟jdk8有asm冲突,建议升级spring4或者使用jdk7就可以了

从异常来看应该是Spring加载Bean过程中,ASM处理类文件出现问题,应该不是Tomcat的问题。

下面从Stackover直接抄过来的。

As @prunge and @Pablo Lozano stated, you need Spring 4 if you want compile code to Java 8 (--target 1.8), but you can still run apps on Java 8 compiled to Java 7 if you run on Spring 3.2.X.

Check out http://docs.spring.io/spring/docs/current/spring-framework-reference/h...

Stackover链接:

http://stackoverflow.com/questions/22526695/java-1-8-asm-classreader-f...

新手上路,请多包涵

tomcat8和jdk没冲突,应该是你使用的其他包对jdk1.8的支持不够。同楼上的,建议先使用jdk1.7

lz 我也遇到同样的情况了,我是在Mac上的jdk1.8,也是报asm 的一个什么包错误,但是在windows上面的代码一样完全是可以的,不知道lz现在解决没?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题