The type org.apache.commons.cli.Options cannot be resolved. It is indirectly referenced from required .class files

在搭建好Hadoop Eclipse开发环境后,编写map-reduce,遇到如下的问题:

image

从字面上可以看出,工程缺少org.apache.commons.cli.Options,这个包被间接的被其他包使用,根据经验推断,这个应该是缺少$HADOOP_HOMT/lib下的某一个包,通过不断的尝试,发现是缺少了commons-cli-1.2.jar包,

image

通过Java Build Path设置后,恢复正常。

原文地址:https://www.cnblogs.com/justinzhang/p/4335475.html