Bharat M
Bharat M

Reputation: 109

Java Build Path Error archive cannot be read

I know this topic has some questions about it already but none have fixed my problem remotely. My project in eclipse has a small red exclamation point next to it and under markers the problem is: Archive Required for library C:\Users....hamcrest...hamcrest-license..txt cannot be read or is not a valid ZIP file. I have tried deleting all jars from my build path leaving on the java library and dependencies. I have restarted, refreshed, cleaned and attempted building without any success.

Upvotes: 0

Views: 711

Answers (1)

Paul Jowett
Paul Jowett

Reputation: 6581

I solved this in a project I saw with the following sequence:

  1. deleting the text file from the file system
  2. go into Eclipse and refresh the project (so it detects the file deleted)
  3. go to Project Properties -> Java Build Path -> Libraries
  4. the file (in my case) was listed and flagged as missing
  5. select and Remove the reference
  6. restore the file on the file system (if you want it)

This probably means simply removing it from the Eclipse Libraries list for the project and then refreshing / clean building. The above is just the order I happened to execute.

I hope that helps.

Upvotes: 1

Related Questions