Hadoop class path

I am trying to run some unit tests for mapper and reducer using junit and mockito.
Do I have to specify the location of the database cells and the main jar resources in the classpath every time I run a test?

I thought that running the "hadoop" command should automatically include all the required libraries at runtime. Is there anyway to avoid injecting hadoop dependencies every time ?.

hadoop -cp /home/xxx/Downloads/mockito-all-1.9.5.jar:/home/xxx/Downloads/junit-4.10.jar:/home/xxx/Downloads/hadoop-1.1.1/hadoop-core-1.1.1.jar:./classes:.:/home/xxx/Downloads/hadoop-1.1.1/lib/commons-logging-1.1.1.jar org.junit.runner.JUnitCore MaxTemperatureMapperTest 

      

+3


source to share


1 answer


You can specify the classpath in the hadoop-env.sh file. "export HADOOP_CLASSPATH = * " The next time you run hasoop, the classpath will be automatically added.



+2


source







All Articles