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

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.

主站蜘蛛池模板: 泽库县| 南靖县| 永丰县| 天柱县| 宣汉县| 石门县| 邵东县| 沅江市| 崇义县| 庆阳市| 万州区| 黎川县| 大安市| 瓮安县| 太仓市| 岳普湖县| 都安| 阳信县| 乾安县| 竹山县| 唐山市| 平邑县| 米脂县| 林州市| 阿荣旗| 广元市| 新建县| 乾安县| 密山市| 光山县| 临澧县| 宣恩县| 大足县| 康乐县| 涞源县| 衢州市| 蒙阴县| 商水县| 阜新市| 阳朔县| 临湘市|