解决方法1: file - setting - bulid,Execcution…-java Complier - 最右侧改为你的jdk版本(如:1.8)
如图:
idea运行main出现Exception in thread "main" Process finished with exit code 1如果 还是出现 :Exception in thread “main” Process finished with exit code 1
解决方法2:file - project structure - modules - 右侧Dependencies - 将servlet-api 后面改为compile
如图
idea运行main出现Exception in thread "main" Process finished with exit code 1再次运行ok

相关文章: