Reputation: 23
I have a jar file which is copied from a windows machine onto unix machine....usually we convert all the files that were copied from windows using dos2unix command.. When I convert the jar file to unix format using dos2unix...I am getting the below error...
Exception in thread "main" java.io.IOException: Error opening job jar: hadoop-examples-2.0.0-mr1-cdh4.3.0.jar
at org.apache.hadoop.util.RunJar.main(RunJar.java:135)
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:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at org.apache.hadoop.util.RunJar.main(RunJar.java:133)
It ran successfully before running dos2unix command on it... Any idea why this happened ?
Upvotes: 0
Views: 7002
Reputation: 201447
Don't do that. A jar
file is the same as a zip
, it's a binary. dos2unix
is for converting line endings in ASCII files (not binary).
Upvotes: 6