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的问题啊 谢谢 大家

jdk8 java tomcat

mysep 9 years, 6 months ago

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

911xp answered 9 years, 6 months ago

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

水野由结的大脸 answered 9 years, 6 months ago

从异常来看应该是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...

注册你妹啊! answered 9 years, 6 months ago

Your Answer