Invalid or corrupt jarFile
I would use a comment for you but I don't have the reputation to comment yet so here goes:
The java version is very possibly an issue. I know that I have had some serious issues very much like what you are explaining because I was using 1.8 (while the project was a 1.6 or 1.7). So using 1.7 instead of 1.8 could definitely be an issue.
I know this doesn't answer your question completely but if possible I would try upgrading your server (probably not an option I know).
Related videos on Youtube
Smeiff
Updated on July 09, 2022Comments
-
Smeiff almost 2 years
This question has been asked various times across this forum but none of these seem to be stemming from the same issue I'm having. So here is my issue...
I have multiple runnable jar files I use for various projects, these are Selenium projects if that makes more sense. I've not had any issues with any of these jars in the past and I have two servers running all the jars. I am able to run the other jars just fine so can't figure out what the issue is. Only thing that is new is I added some new dependencies in this specific project. On two of my machines this jar works fine. I stored the jar on the network and ran it from these two machines - works fine. Run it from the server machine and I get "Invalid of corrupt jarFile xxx.jar". Since this error is so generic I have no idea what to go on...
Run the jar by using "java -jar xxx.jar [params]".
I did notice that the java version on my two machines is 1.8 and the server is 1.7 however the project is built on java 1.7.
Any idea on this?
-
randrade86 over 8 yearsSugestion: Use a checksum (md5, sha2, etc) to ensure that your jar was successfully transfered between your 2 machines and the server.
-
Smeiff over 8 yearsChecksum matches I thought about that as well before but didn't check.
-
randrade86 over 8 yearsTry running your jar with classpath flag. Like
java -cp xxx.jar YourMainClass
-
Smeiff over 8 yearsThat worked... does that narrow down where the issue could be from?
-
randrade86 over 8 yearsSounds like it's an issue with your MANIFEST.MF file, can you post it?
-
Smeiff over 8 yearsHere you go... pastebin.com/2CQwgjXz
-
Admin about 6 years
-
Smeiff about 6 yearsThis comment isn't helpful. In this case it is not a code question but a running a jar problem. Adding an entire code library would not help out.
-
-
Smeiff over 8 yearsI didn't feel like wasting more time troubleshooting this. I just decided to shoot for the upgrade and it worked. I have no idea why this was happening. Shouldn't be the solution but it works for me!