hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: Possible to run an application jar as a hadoop daemon?
Date Sat, 05 Jan 2013 07:48:03 GMT

On Fri, Jan 4, 2013 at 8:10 PM, Krishna Rao <krishnanjrao@gmail.com> wrote:
> If I want to run the jar I need to run it using "hadoop jar <application jar>",
so that it can access HDFS (that is running "java -jar <application jar> results in
a HDFS error").

The latter is because running a Hadoop program requires Hadoop
dependencies and configs to be available in its runtime classpath.
This can be achieved by either creating a fat jar assembly, containing
config files and all required dependency jars; or you can run it as:
java -cp yourjar.jar:`hadoop classpath` YourMainClass <args> such that
the classpath is automatically setup for you.

Harsh J

View raw message