You can reference the below steps:
Step 1: Copy the code to you eclipse and export the jar.
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTgwMTkwMCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.uQbKumch3qx4IcwBmmyA6-1OU-oPiJGJlWhPf4aqmpI)
Now for exporting the jar part, you should do this:
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTgwMTkyNCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.ocxDE3320eIi9H5nhVeXW_I6xSnb9czD5rqbam4XCUc)
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTgwMTkyNiwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.AEvwIo01B-XWOxcCvckNkjhWESrsT4NogjR9ukoId5Y)
Now, browse to where you want to save the jar file.
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTgwMTkzOSwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.nzJrRduJLVtVNGdQO5stW3M21_Nqj35DdH-0Rb4HonE)
Step 2: Copy the dataset to the hdfs using the below command:
hadoop fs -put wordcountproblem
Step 3: Check if dataset was stored in hdfs:
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTc0OTQ2OCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.QXHbemMfGTjbo6GTWe8aONhLo1kpyd9S0Pn9Py7Tm1w)
Step 4: Execute the MapReduce code:
Syntax:
hadoop jar jar_name package_name.class_name input_path_in_hdfs output_path_in_hdfs
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTc0OTUwNSwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.Lyfd8i1CjXcj3yuuhWLTzpF2Gki082aDBjkLeC4MFtU)
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTc0OTUzOCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.FdlK6zS3d1h4XqwOSRuZMXga06c53wb6ps1VY5pH2nY)
Step 8: Check the output directory for your output
![image image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA1OTc0OTU2NCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.NFsq35sL2tUHJ1OU2Tx-h_Sd7GvkZEwe9l0zIcGvYzE)