idea在maina方法运行出现错误:
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
网上没找到,只有eclipse 的,自我思考
原因:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>${servlet.version}</version> <scope>provided</scope> </dependency>
因为javax.servlet 依赖没引来
解决
把红圈勾上就可以了