Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to compile Java Hadoop programs.

I have compiled and got .class files for mapper and reducer.

But when I compile mainjava file, i keep getting this error.

enter image description here that is it can't point mapper and reducer class files.

How can I resolve this issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
188 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have to give all of your source files to javac

Example:

 javac -classpath /usr/local/hadoop/hadoop-core-1.0.4.jar -sourcepath src/ -d build/ MyMain.java MyMapper.java MyReducer.java

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...