1,eclipse导入项目jdk版本不一样解决方案 2,java报javax.servlet.jsp cannot be resolved to a type

一:eclipse导入项目jdk版本不一样解决方案

参考博文:

https://www.cnblogs.com/chenmingjun/p/8472885.html

选中项目右键 --> Properties --> Build Path --> 选中Libraries一栏,移除(Remove)这个库选项,

  然后添加新的库选项:

  Add Library... --> JRE System Library --> next --> Execution environment --> Environments... --> 选择JavaSE-9(jdk-9.0.4) --> Apply and Close。

  或者直接右键 JRE System Library[JavaSE-1.7] --> Properties --> Execution environment --> Environments... --> 选择JavaSE-9(jdk-9.0.4) --> Apply and Close。

二:java报javax.servlet.jsp cannot be resolved to a type

参考博文:https://blog.csdn.net/weixin_37997251/article/details/80701897

这个错误可能是服务器自带的servlet库未导入的原因。右键项目属性,转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决。

猜你喜欢

转载自www.cnblogs.com/smartisn/p/11569807.html