一个eclipse中开发的web工程,导入进myeclipse中,在启动tomcat时,提示
The import javax.servlet.http.HttpSession cannot be resolved
The import javax.servlet.http.HttpSessionEvent cannot be resolved
The import javax.servlet.http.HttpSessionListener cannot be resolved
HttpSessionListener cannot be resolved to a type
HttpSessionEvent cannot be resolved to a type
HttpSessionEvent cannot be resolved to a type
错误,从网上查找来看,是缺少了servlet-api.jar文件,把tomcat/lib下的servlet-api.jar文件拷入到工程的lib目录下,重新启动tomcat,又报告如下错误:
validateJarFile(C:\Tomcat7\webapps\PDEInterface\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
通过在eclipse中,两个工程比较来看,eclipse中在build path中通过add library中选择了Server runtime,使用了tomcat/lib目录下的包,而myeclipse中却没有这个选项。在myeclipse中把tomcat/lib目录下的包通过Add external folder加入到工程中,还是无法启动tomcat。
请问,如何设置,才能让工程在myeclipse中正常使用?