jar文件无效或损坏 [英] Invalid or corrupt jarFile

查看:1404
本文介绍了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...

我有多个可运行的jar文件,我用于各种项目,这些是Selenium项目,如果这更有意义。过去我没有任何这些罐子有任何问题,我有两台服务器运行所有的罐子。我能够运行其他罐子很好,所以不能弄清楚是什么问题。只有新的东西是在这个具体的项目中添加了一些新的依赖项。在我的两台机器上,这个jar工作正常。我将这个jar存储在网络上,并从这两台机器上运行 - 工作正常。从服务器机器运行它,我得到无效的损坏的jarFile xxx.jar。因为这个错误是如此通用,我不知道该怎么办...

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

使用java -jar xxx.jar [params]运行jar。

Run the jar by using "java -jar xxx.jar [params]".

我注意到,我的两台机器上的java版本是1.8,服务器是1.7,但是这个项目是建立在java 1.7上的。

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.

有什么想法吗?

我已经将问题跟踪到依赖,如果这有任何意义。我删除这个依赖和jar不再腐败,只是得到一个log4j异常。

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.

<dependency>
        <groupId>com.smartbear.soapui</groupId>
        <artifactId>soapui-pro-maven-plugin</artifactId>
        <version>5.1.2</version>
    </dependency>

为什么这会损坏jar?

Why would this corrupt the jar?!

决定将我的服务器java升级到1.8,它工作正常。我去了这个解决方案,但我很想知道为什么我不得不浪费这么多时间。

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:

java版本很可能是一个问题。我知道我有一些严重的问题非常像你正在解释的,因为我使用1.8(而项目是1.6或1.7)。所以使用1.7而不是1.8可以肯定是一个问题。

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

这篇关于jar文件无效或损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆