Building your first Hadoop Jar with maven and eclipse

This guide walks through creating your fist Hadoop program, but it skips over some important details, like how to compile a Jar file… It relies on the assumption that you’ve already compiled all of your Java code. Small assumption, but if you come from a C# programming background this may be confusing. Don’t worry it’s fairly easy if you use eclipse for an IDE and maven to manage the project dependencies.

Again, this post is complementary to an Azure walk through. Open it up! 


First, download and install eclipse. Then create a new project using Maven




Choose the quick start archetype




Add a group ID, this is where your code will live, and a ArtificatID, which is your class name




We’ll need to update the pom.xml file. Double click and choose pom.xml



Copy the below code as your pom.xml

project xmlns="" xmlns:xsi=""

Now copy over the code from the Azure documentation into your class.

Now the benefit of an IDE shows right up 🙂


Deprecation! Noooooooo. No worries, I got you. Use this line to create your job

Job job = Job.getInstance(conf, “word count”);

If you are getting errors you may need to update your maven project so you’ll be able to import the correct references


Ok now let’s package our jar file. Right click your project, choose Run As, and Maven build


Change the goal to package



Wala! If the build completes successfully, you’ll “fat” jar file will be in your project repository under ./target.

From here you can use this jar file to complete the remainder of the tutorial!

~Happy Developing


Leave a Reply

Your email address will not be published. Required fields are marked *