简体   繁体   中英

Running Hadoop jar command through Java

I want to run this command in linux through java code. I am writing a java code to run all hadoop commands instead of typing one by one.

hadoop jar WordCount.jar WordCount input/wordcount.txt output

I tried Runtime.getRuntime().exec(command) ; it did not work with hadoop. Also, I tried ProcessBuilder and it did not work too. Is there anyway to run hadoop command through java code ?

尝试hadoop jar WordCount.jar ur_pacjage_name.WordCount输入/wordcount.txt输出

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM