Java 错误:无效或损坏的 jarfile

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36490385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 17:55:44  来源:igfitidea点击:

Error: Invalid or corrupt jarfile

javaeclipsemavenjar

提问by Minkyu Kim

I wrote my java application via Eclipse Luna on Windows. And It is maven project. I exported runnable jar filewith Extract required libraries into generated JARoption.

我在 Windows 上通过 Eclipse Luna 编写了我的 Java 应用程序。它是maven项目。我runnable jar fileExtract required libraries into generated JAR选项导出。

And then, copied and ran via java8 openjdk java8 -jar chatserver.jaron linux server(EC2 Amazon Linux).

然后,java8 -jar chatserver.jar在 linux 服务器(EC2 Amazon Linux)上通过 java8 openjdk 复制并运行。

However console outputs just error.

但是控制台输出只是错误。

Error: Invalid or corrupt jarfile chatserver.jar

错误:无效或损坏的 jarfile chatserver.jar

Here is my menifest.mf

这是我的menifest.mf

Manifest-Version: 1.0
Class-Path: .
Main-Class: {serviceDomain}.chat.ChatServer

Name: org/aspectj/lang/
Implementation-Title: org.aspectj.tools
Implementation-Version: 1.8.2
Bundle-Name: AspectJ Runtime
Bundle-Version: 1.8.2
Specification-Vendor: aspectj.org
Specification-Title: AspectJ Runtime Classes 
Bundle-Copyright: (C) Copyright 1999-2001 Xerox Corporation, 2002 Palo
   Alto Research Center, Incorporated (PARC), 2003-2009 Contributors. 
  All Rights Reserved.
Specification-Version: 1.8
Implementation-Vendor: aspectj.org

How can I export java application correctly, or deploy my appliction easily?

如何正确导出 java 应用程序,或轻松部署我的应用程序?

采纳答案by Minkyu Kim

vServer Linux - Start jar: Invalid or corrupt jarfile

vServer Linux - 启动 jar:无效或损坏的 jarfile

I found my answer.

我找到了我的答案。

I changed ftp mode to binary then works.

我将 ftp 模式更改为二进制然后工作。