标签:directory java server central user sed bsp dir err
从ftp上上传jar包到linux上,之后在linux上通过ftp命令下载jar包文件,开始执行Java-jar,一直提示错误:Error: Invalid or corrupt jarfile xxx.jar
但是,本地在cmd下执行通过。
本来我们是打算通过yarn jar或者hadoop jar来执行命令一个hdfs文件操作的功能,但是一直提示:
[c@v0283~]$ hadoop jar /app/c/h_ConvertHdfsZipFileToGzipFile.jar WARNING: Use "yarn jar" to launch YARN applications. Exception in thread "main" java.io.IOException: Error opening job jar: /app/c/H_ConvertHdfsZipFileToGzipFile.jar at org.apache.hadoop.util.RunJar.run(RunJar.java:160) 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.ZipFile.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) ... 1 more
wget ftp://ip:port/software/os/ubuntu12.04/ubuntu-12.04.1-server-amd64.iso --ftp-user=username --ftp-password=password
ftp下载过程中修改了jar文件的格式问题导致,而wget可以确保格式不受损。
Java:Linux上java -jar xxx.jar命令执行jar包时出现Error: Invalid or corrupt jarfile xxx.jar解决方案
标签:directory java server central user sed bsp dir err
原文地址:http://www.cnblogs.com/yy3b2007com/p/7659035.html