Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hadoop Yarn Simple Application error

Solved Go to solution
Highlighted

Hadoop Yarn Simple Application error

New Contributor

I am trying to run the simple yarn application listed here: https://github.com/hortonworks/simple-yarn-app

I am a beginner with both Java and Hadoop, and when I try to compile the simple yarn Client file using 'javac', I get the following error:

Client.java:9: error: package org.apache.hadoop.conf does not exist

import org.apache.hadoop.conf.Configuration;

The command I am using to compile the file is:

javac Client.java

I have Googled this error to see if I could find which JAR file is missing from my classpath, but I couldn't find anything helpful with respect to YARN. Most of the results were related to HBASE, PIG or HIVE.

Can someone please point me towards the relevant JAR file I am missing here? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Hadoop Yarn Simple Application error

Guru

@MCarter@hortonworks.com the easiest way to compile this is going to be with Maven. The list of dependencies is rather lengthy and you will spend a good bit of time trying to include them all if you want to use javac. If you have never used Maven before then it probably isn't installed on your Mac either. The easiest way to install Maven is going to be with the Mac package manager "Homebrew". You might not have that installed either but its a simple one liner to install. More information on HomeBrew can be found here. It is commonly used among developers on OSX.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After HomeBrew (brew) is installed run this command to install Maven.

brew install maven

Once you have successfully installed Maven you can compile the project by changing to the directory where the pom.xml file is located and running.

mvn clean install package

Once that has completed you will see the resulting jar at ./target/simple-yarn-app-1.1.0.jar Hope that helps.

2 REPLIES 2

Re: Hadoop Yarn Simple Application error

Rising Star

Please have a look at the POM.xml as this lists the dependencies.

Re: Hadoop Yarn Simple Application error

Guru

@MCarter@hortonworks.com the easiest way to compile this is going to be with Maven. The list of dependencies is rather lengthy and you will spend a good bit of time trying to include them all if you want to use javac. If you have never used Maven before then it probably isn't installed on your Mac either. The easiest way to install Maven is going to be with the Mac package manager "Homebrew". You might not have that installed either but its a simple one liner to install. More information on HomeBrew can be found here. It is commonly used among developers on OSX.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After HomeBrew (brew) is installed run this command to install Maven.

brew install maven

Once you have successfully installed Maven you can compile the project by changing to the directory where the pom.xml file is located and running.

mvn clean install package

Once that has completed you will see the resulting jar at ./target/simple-yarn-app-1.1.0.jar Hope that helps.

Don't have an account?
Coming from Hortonworks? Activate your account here