官术网_书友最值得收藏!

  • Hadoop Beginner's Guide
  • Garry Turkington
  • 152字
  • 2021-07-29 16:51:39

Time for action – building a JAR file

Before we run our job in Hadoop, we must collect the required class files into a single JAR file that we will submit to the system.

Create a JAR file from the generated class files.

$ jar cvf wc1.jar WordCount1*class

What just happened?

We must always package our class files into a JAR file before submitting to Hadoop, be it local or on Elastic MapReduce.

Tip

Be careful with the JAR command and file paths. If you include in a JAR file class the files from a subdirectory, the class may not be stored with the path you expect. This is especially common when using a catch-all classes directory where all source data gets compiled. It may be useful to write a script to change into the directory, convert the required files into JAR files, and move the JAR files to the required location.

主站蜘蛛池模板: 凭祥市| 闸北区| 苏州市| 克山县| 融水| 梧州市| 右玉县| 延川县| 康保县| 缙云县| 当雄县| 牡丹江市| 崇州市| 健康| 克什克腾旗| 亚东县| 广宗县| 金沙县| 新源县| 北票市| 乌拉特后旗| 榆树市| 高碑店市| 黎川县| 汶上县| 瑞金市| 四会市| 凤庆县| 黑水县| 乐陵市| 固安县| 京山县| 华池县| 临高县| 延庆县| 米易县| 宁河县| 宁陕县| 团风县| 五台县| 临沂市|