简体   繁体   中英

Hadoop classpath command overwrites jar

I am trying to include hadoop classpath in my jar's manifest file . I have tried to use hadoop classpath --jar myjar.jar

But the command over writes all the content of my jar. Could you please help me?

You are misusing hadoop classpath .

From http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/CommandsManual.html#classpath .

Usage: hadoop classpath [--glob |--jar |-h |--help]

COMMAND_OPTION Description

--glob expand wildcards

--jar path write classpath as manifest in jar named path

-h, --help print help

Prints the class path needed to get the Hadoop jar and the required libraries. If called without arguments, then prints the classpath set up by the command scripts, which is likely to contain wildcards in the classpath entries. Additional options print the classpath after wildcard expansion or write the classpath into the manifest of a jar file. The latter is useful in environments where wildcards cannot be used and the expanded classpath exceeds the maximum supported command line length.

As the Hadoop Commands manual clearly states, passing a jar will write the manifest into the jar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM