欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

解决使用maven的java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file...

程序员文章站 2022-03-02 16:53:07
...

java web项目一直都是好好的,后面电脑安装过系统后(以之前的版本不一样),安装所需软件(如myeclipse、tomcat)并进行配置。然后在myeclipse中添加项目却报错了

1.Archive for required library: ‘...  .jar’ 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.

但是我查找了一下那个jar确实是存在的。在网上查找了许久,答案不一:jar不完整、路径问题等等。
解决方案:
1)删除提示错误路径下的所有jar包(C:\Documents and Settings\Administrator.m2\repository\org...)。
2)安装maven,详细的安装步骤点击here,
3)开始—运行—cmd—进入到web项目所在路径(cd:web项目的路径)

(a)输入mvn compile(编译源代码)回车;
(b) mvn clean (清除目标目录中的生成结果)回车;
(c)输入**mvn clean install或者****mvn clean install -DskipTests=true(下载所需jar)回车。