简体   繁体   English

错误:无法读取所需库的存档或者不是有效的ZIP文件。

[英]Error: Archive for required library cannot be read or is not a valid ZIP file.

I am having trouble setting up the build path of my java project. 我在设置java项目的构建路径时遇到问题。 I am currently in a Co-Op IT position so I am somewhat new to all this. 我目前处于Co-Op IT职位,所以我对这一切都有点新意。 My background is mostly in C++ and I am learning java on the fly. 我的背景主要是在C ++中,我正在学习java。 I am also somewhat new to Eclipse (Kepler service release 1). 我也是Eclipse的新手(开普勒服务版本1)。

I am working on a bug on an existing program and need to get the program to build so I can work on it. 我正在处理现有程序的错误,需要让程序构建,以便我可以处理它。 When I add all of the external .jar files that I know for a fact are the right ones, I am getting this error on two of them : 当我添加我知道的所有外部.jar文件是正确的,我在其中两个上面得到这个错误:

"Archive for required library: '(location of file)' cannot be read or is not a valid ZIP file" “存档所需的库:'(文件的位置)'无法读取或不是有效的ZIP文件”

Two of the other full time guys on my team have gotten the program to run with those exact same .jar files, one running Eclipse Indigo and the other running the same Kepler version as myself. 我团队中的其他两个全职人员已经使用那些完全相同的.jar文件运行程序,一个运行Eclipse Indigo,另一个运行与我自己相同的Kepler版本。 I also was able to open the two .jar files manually and everything appears to be there. 我也能够手动打开两个.jar文件,一切都在那里。 After every trial trying to fix this, I have refreshed, cleaned and restarted eclipse. 每次尝试解决这个问题后,我都会刷新,清理并重新启动eclipse。 The two other full time guys said they have never seen this error. 另外两个全职人员说他们从未见过这个错误。 I would like to get some insight on this from anyone who has any similar experiences so that I don't have to use up much more of their time. 我想从任何有类似经历的人那里获得一些见解,这样我就不必耗费更多的时间。

I Had this issue, just fixed by deleting .jar files from Libs directory then copy->paste original Jars again. 我有这个问题,只需从Libs目录中删除.jar文件,然后再复制 - >粘贴原始Jars。 Then do a complete clean -> rebuild 然后做一个完整的清理 - >重建

I got this problem, took help from following link solution which basically says to 1. delete the corresponding maven download folder 2. maven>update project in eclipse 我遇到了这个问题,从以下链接解决方案中获取帮助,主要是说1.删除相应的maven下载文件夹2. maven>更新eclipse中的项目

In my case I deleted hibernate folder, since i was getting error related to hibernate-validator.jar 在我的情况下,我删除了hibernate文件夹,因为我收到了与hibernate-validator.jar相关的错误

I had the same error here. 我在这里遇到了同样的错误。 What I did to resolve the problem was close and reopen the project. 我解决问题的方法是关闭并重新打开项目。

我遇到了同样的问题,发现根本原因是我的linux shell中的JDK设置为1.6,但在eclipse中,JRE是1.7。

Using Eclipse without m2e features (Standard Edition) helped me. 使用没有m2e功能的Eclipse(标准版)帮助了我。

Similar problem with Spring toolsuite 与Spring tooluite类似的问题

Just came across this link that shows a way to get unblocked. 刚刚看到这个链接 ,显示了一种解除阻止的方法。 In preferences dialog box go to 在首选项对话框中转到

Java->Compiler->Building

and change Incomplete build path to "Warning" (from default "Error") This can be done globally (for all projects), or on a project by project basis. 并将不完整的构建路径更改为“警告”(默认为“错误”)这可以在全局(对于所有项目)或逐个项目的基础上完成。

Check the jar's file permissions/ownership. 检查jar的文件权限/所有权。 I had the same issue on eclipse installed on Linux and fixed it by setting the file permissions right. 我在Linux上安装的eclipse上遇到了同样的问题,并通过设置文件权限来修复它。

In my case ..worked after removing this from spirngrest-servlet.xml file. 在我的情况下..从spirngrest-servlet.xml文件中删除它后工作。

    <prop key="net.sf.ehcache.configurationResourceName">/Sysehcache.xml</prop>

I think it had to do with default location of maven repository of jar files. 我认为这与jar文件的maven存储库的默认位置有关。 Been at it for 3 days. 已经3天了。 finally solved it.Hope it helps anyone.Just look for similar think in your spirngrest-servlet.xml file. 终于解决了它。希望它可以帮助任何人。只需在你的spirngrest-servlet.xml文件中寻找类似的思考。 Good luck. 祝好运。

I just tried the following and it worked: 我只是尝试了以下它,它工作:

Close eclipse as there might be some files eclipse is accessing and you won't be able to delete. 关闭eclipse,因为可能有一些文件eclipse正在访问,你将无法删除。

Delete all the libraries installed in the maven repositories folder: ".m2/repository" 删除maven存储库文件夹中安装的所有库:“。m2 / repository”

Open eclipse and update your project(Alt+F5). 打开eclipse并更新项目(Alt + F5)。

What did we just do? 我们刚刚做了什么? : This is possible that the existing libraries in the local repository are erroneous and maven tries to open which it fails in. We have now deleted the already existing library and with the project update, Maven will download the library again which should resolve the issue. :这可能是本地存储库中的现有库是错误的,并且maven尝试打开它失败的。我们现在已经删除了已经存在的库,并且通过项目更新,Maven将再次下载该库以解决该问题。

i fixed this by just deleting everything inside of the /Users/username/.m2/repository folder. 我通过删除/Users/username/.m2/repository文件夹中的所有内容来修复此问题。 not the repository folder itself. 不是存储库文件夹本身。 and then running a mvn clean package in the project folder 然后在项目文件夹中运行mvn clean包

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 eclipse maven错误:项目中所需库的归档无法读取或不是有效的ZIP文件 - eclipse maven error: Archive for required library in project cannot be read or is not a valid ZIP file Maven eclipse错误:“无法读取所需库的存档或不是有效的ZIP文件” - Maven eclipse error: "Archive for required library cannot be read or is not a valid ZIP file" 无法读取项目中所需库tomcat-embed-websocket的存档,或者该存档不是有效的ZIP文件 - Archive for required library tomcat-embed-websocket in project cannot be read or is not a valid ZIP file 所需库的存档:使用ChromeDriver Selenium Java无法读取项目“ XYZ”中的“ lib / Chrome / chromedriver”或该文件不是有效的ZIP文件 - Archive for required library: 'lib/Chrome/chromedriver' in project 'XYZ' cannot be read or is not a valid ZIP file using ChromeDriver Selenium Java 键入所需库的存档:无法读取项目&#39;starter&#39;中的spring-core-4.0.1.RELEASE.jar&#39;或它不是有效的ZIP文件 - Type Archive for required library: spring-core-4.0.1.RELEASE.jar' in project 'starter' cannot be read or is not a valid ZIP file Maven Archive无法读取或不是有效的Zip文件? - Maven Archive cannot be read or is not a valid Zip file? Java构建路径错误-(项目)中的(库)在Eclipse中无法读取或不是有效的zip文件 - Java build Path error - (library) in (project) cannot be read or is not a valid zip file in Eclipse STS项目给出错误无法读取或不是有效的ZIP文件 - STS project gives error cannot be read or is not a valid ZIP file Hibernate 配置文件:存档所需的库持久性。xml 无法读取 - Hibernate configuration file : Archive for required library persistence.xml cannot be read 无法读取所需库的存档 - archive for required library can not be read
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM