Code for this blobpost.
Please note that this is an example and not production-ready code. If you want a productionalized and working clustering, use Mahout, Hama or Spark.
You will need Java 8 to build this library.
You can simply build with:
mvn clean package install
The created jars contains debuggable code + sources + javadocs.
To generate eclipse files use: