导入别人Java项目的两个常见报错及解决方法

1.在Eclipse 中编写servlet时出现:The import javax.servlet cannot be resolved 错误,如下图
![https://img-blog.csdn.net/20160814155837035?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)]
解决方法就是:在Eclipse中,右击项目,选择Build Path->configure build path->Libraries->Add External JARs,找到你计算机中tomcat的解压路径,在lib文件夹下选中"servlet-api.jar"和"jsp-api.jar"(如果都有了就不要在添加),添加点击“确定”

2.eclipse里error报错Target runtime com.genuitec.runtime.generic.jee60 is not defined.
解决方法:点此链接添加链接描述

猜你喜欢

转载自blog.csdn.net/weixin_42206151/article/details/84801526