简体   繁体   English

Hadoop classpath命令覆盖jar

[英]Hadoop classpath command overwrites jar

I am trying to include hadoop classpath in my jar's manifest file . 我试图在jar的清单文件中包含hadoop类路径。 I have tried to use hadoop classpath --jar myjar.jar 我试图使用hadoop classpath --jar myjar.jar

But the command over writes all the content of my jar. 但是命令覆盖了我jar的所有内容。 Could you please help me? 请你帮助我好吗?

You are misusing hadoop classpath . 您正在滥用hadoop classpath

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

Usage: hadoop classpath [--glob |--jar |-h |--help] 用法:hadoop类路径[--glob | --jar | -h | --help]

COMMAND_OPTION Description COMMAND_OPTION说明

--glob expand wildcards --glob扩展通配符

--jar path write classpath as manifest in jar named path --jar路径将类路径作为清单中的清单文件写入路径

-h, --help print help -h,--help打印帮助

Prints the class path needed to get the Hadoop jar and the required libraries. 打印获取Hadoop jar和所需库所需的类路径。 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. 其他选项可在通配符扩展后打印类路径,或将类路径写入jar文件的清单中。 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. 正如Hadoop Commands手册明确指出的那样,传递一个jar将把清单写入到jar中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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