This example of MapReduce job is direct port of this tutorial written in Scala with minimum deps.
sbt assembly
The uberjar will be stored in target/scala-2.12/main.jar
./bin/hadoop jar /path/to/main.jar harippe.hadoop.example.mapReduce.WordCount /hdfs/path/of/input/dir /hdfs/path/of/output