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

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.

主站蜘蛛池模板: 乡城县| 仙桃市| 繁昌县| 中牟县| 东城区| 石柱| 乌兰浩特市| 温州市| 曲靖市| 光泽县| 宣威市| 南岸区| 鄂伦春自治旗| 北海市| 叶城县| 垣曲县| 杨浦区| 黑水县| 宜兰县| 定兴县| 偃师市| 大宁县| 沈阳市| 靖安县| 小金县| 遂溪县| 吉安市| 连山| 北辰区| 达日县| 南安市| 玉环县| 东台市| 岳普湖县| 灵武市| 平远县| 承德市| 丹寨县| 仙桃市| 长子县| 南阳市|