今天導入以前的2個web項目后會出現以下三個錯誤:
1. Archive for required library: ‘WebContent/WEB-INF/lib/readme.txt’ in project ‘xxxxxxxxx’ cannot be read or is not a valid ZIP file
2. The project cannot be built until build path errors are resolved
3. Target runtime Apache Tomcat v6.0 is not defined.
這三個問題都很好解決,方法如下:
1. 用記事本打開項目根目錄的.classpath文件,找到“<classpathentry kind=”lib” path=”WebContent/WEB-INF/lib/readme.txt”/>”這一行,刪掉
2. 第一個問題解決后,此問題也會消失
3. 打開項目根目錄下.settings文件夾中的org.eclipse.wst.common.project.facet.core.xml文件,將“<runtime name=”Apache Tomcat v6.0″/>”這一句改成現在所需要的tomcat版本,或者刪除中間幾行,只留下下面三行就行 “<?xml version=”1.0″ encoding=”UTF-8″?> <faceted-project> </faceted-project>”