java jar 无效,jar文件无效或损坏

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).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值