Error:invalid or corrupt jarfile Xxx.jar solution when Java-jar Xxx.jar command executes jar package on Java:linux

Source: Internet
Author: User

Background:

Upload jar package from FTP to Linux, then download jar package file on Linux via FTP command, start execution Java-jar, always prompt error: error:invalid or corrupt jarfile Xxx.jar

However, local execution is carried out under CMD.

We were going to run a HDFs file operation via the yarn jar or Hadoop jar, but always prompt:

[c@v0283~]$ Hadoop jar/app/c/H_ConvertHdfsZipFileToGzipFile.jarWARNING:Use"yarn Jar"To launch YARN applications. ExceptioninchThread"Main"Java.io.IOException:Error opening job jar:/app/c/H_converthdfszipfiletogzipfile.jar at Org.apache.hadoop.util.RunJar.run (Runjar.java: the) at Org.apache.hadoop.util.RunJar.main (Runjar.java:136) caused By:java.util.zip.ZipException:invalid END header (bad Central directory offset) at Java.util.zip.ZipF Ile.open (Native Method) at Java.util.zip.ZipFile.<init> (Zipfile.java:219) at Java.util.zip.ZipFile.<init> (Zipfile.java:149) at Java.util.jar.JarFile.<init> (Jarfile.java:166) at Java.util.jar.JarFile.<init> (Jarfile.java:103) at Org.apache.hadoop.util.RunJar.run (Runjar.java:158)        ... 1More
Solution:

wget Ftp://ip:port/software/os/ubuntu12.04/ubuntu-12.04.1-server-amd64.iso--ftp-user=username--ftp-password= Password

Problem cause Analysis:

The format of the jar file was modified during the FTP download, and wget can ensure that the format is not compromised.

Error:invalid or corrupt jarfile Xxx.jar solution when Java-jar Xxx.jar command executes jar package on Java:linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.