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?
Update
I have tracked down the issue to a dependency if that makes any sense at all.. I remove this dependency and jar is no longer corrupt, just get a log4j exception.
com.smartbear.soapui
soapui-pro-maven-plugin
5.1.2
Why would this corrupt the jar?!
Update 2:
Decided to just upgrade my servers java to 1.8 and it works fine. I went with this solution but I would love to find out why I had to waste so much time with this.
解决方案
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).