Error: FileAlreadyExistsException: Output directory FileAlreadyExistsException: Output directory file:/home/data/mapReduce/data already exists
As shown in the figure above, when the jar package is running, an error is reported in the form of parameter passing, saying that the output path already exists! ? However, if you observe carefully, you will find that the existing path mentioned by the system is actually the input path of the resource file, that is to say, it is misplaced when the parameters are obtained, and it is suspected that a parameter has been shifted to the left.
So its program was modified,Move the parameter array element to the right by one, starting from 1, Run again: the
result is output normally!
giao~
Refer to the blog post of the big guy: https://blog.csdn.net/Scorpius8928/article/details/36875583?ops_request_misc=&request_id=&biz_id=102&utm_term=jar%E5%8C%85hadoop%E9%9B%86%E7% BE%A4%E8%BF%90%E8%A1%8C%E8%B7%AF%E5%BE%84%E4%BB%A5%E5%8F%82%E6%95%B0%E5%BD% A2%E5%BC%8F&utm_medium=distribute.pc_search_result.none-task-blog-2 all sobaiduweb~default-1-36875583.first_rank_v2_pc_rank_v29
Here I think it can be understood that the configuration of loading the main class when running the jar package is a parameter by default args[0]
, so when you write the parameters later, you have to start from 1~
Verify the narrative of the boss (the content of the red box in the picture,Note: The main loading class will only be specified when the packaging method is ②):