springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

问题一.springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgumentException

问题二.或者IDEA启动tomcat抛出-------Error:java: 无效的目标发行版: 1.8

1.原因:spring3.2和java1.7不兼容。
2.解决方法:将项目环境全部换成1.7
1).点击File-Project Structure-Project

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument_第1张图片

2).点击File-Project Structure-Modules-Sources

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument_第2张图片

3).点击File-Project Structure-Modules-Dependencies

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument_第3张图片

4).点击File-Project Structure-SDKs

在这里插入图片描述

5).点击Tomcat的Edit Configurations

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument_第4张图片

补充:与环境变量JDK1.7或者1.8无关。(附图)

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument_第5张图片
按照上述步骤1)------5),配好。我的环境变量是JKD1.8也也可。

你可能感兴趣的:(springmvc)