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

  • 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.

主站蜘蛛池模板: 石家庄市| 海口市| 周口市| 龙海市| 柳河县| 宜州市| 县级市| 苍山县| 平山县| 故城县| 北辰区| 衡南县| 保定市| 普兰县| 宁波市| 桦南县| 无棣县| 乃东县| 平原县| 收藏| 项城市| 沙洋县| 九龙城区| 蒙山县| 裕民县| 安顺市| 淮北市| 辉县市| 兴国县| 报价| 宁安市| 隆林| 伊吾县| 三穗县| 松潘县| 安岳县| 通渭县| 云林县| 九江县| 五家渠市| 重庆市|