一、问题来源
编写HBase-Java代码,配置Maven pom.xml文件出现
二、问题原因
hbase包需要tools.jar,而当前依赖中没有
三、解决方法
加入一个新依赖项目
注意:使用绝对路径(使用相对路径出现其他错误,未解决)
四、代码
<dependencies>
<!--HBase依赖-->
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<!--附加依赖-->
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>C:/Program Files/Java/jdk1.8.0_144/lib/tools.jar</systemPath>
</dependency>
</dependencies>