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 依赖没引来

解决

idea  中main 方法运行错误二

把红圈勾上就可以了

 

相关文章:

  • 2022-12-23
  • 2021-05-11
  • 2021-08-17
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2021-05-31
  • 2021-12-24
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-10-19
  • 2021-09-10
  • 2021-04-19
  • 2022-12-23
  • 2021-07-22
相关资源
相似解决方案