Before coming to the problem let me explain what I did that has landed me in the problem.
In my case restarting Eclipse did not solve the problem. I restarted the computer and did a Project -> Clean
in eclipse
I will say that it can be that some answers work for some cases, but for me it was necessary to go an extra mile. So I will try to make a summary of what can be done:
Verify that the jars are intact:
jar tf myjar.jar
Restart eclipse and update projects setting over right click on project -> Maven -> Update project
The option which has work for me was to navigate in the workspace folder and then delete the files:
.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache
.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache
After that restart eclipse and rebuild project.
I've seen the same issue. I removed that jar file, and then rightclick on the project, select maven, and do "update project...". The jar was downloaded again, and the problem was gone.
Looks like everyone has different story to tell! For me, I had to delete the error from eclipse Markers tab, and then cleaned the project again. Before that, I closed and re-opened the project/eclipse several times as suggested by @rachit, which did not work for me.
Could be due to corrupted jar files as well. Better to check that first as that was the reason in my case:
jar tf myjar.jar
should list the content inside.
For us, the problem seemed to be the size of the .jar file. I would recommend doing the following test to see whether this is the case or at least rule it out. First have a look at other jars in your Eclipse project and compare them to the problemetic jar. Is it a lot bigger than the others? If so, try the following workaround. Else, this answer probably won't help you. Before starting, configure Windows to treat .jar files as .zip files with the following command line command:
assoc .jar=CompressedFolder
(see https://superuser.com/questions/121540/can-you-configure-windows-to-open-jar-files-like-zip-files-without-a-3rd-party-t)
Before trying the workaround, here is a test to see if it is indeed the jar file size that's tripping you up.
If it is indeed size that's the problem, which you might have identified by doing the optional simple test above, you can try the following workaround.
The steps might be a bit unclear, so here's an example. Imagine your jar file was called mylib.jar. You unzip this to a folder called mylib. Inside, let's say there are three sub-folders called package1, package2 and package3. Create 3 folders called mylib1, mylib2 and mylib3, and put in package1, package2 and package3 respectively. Then zip these up and rename extension to .jar. You'll then be importing mylib1.jar, mylib2.jar and mylib3.jar.