object hbase不是org.apache.hadoop包的成员

byqmnocz  于 2021-07-13  发布在  Hadoop
关注(0)|答案(1)|浏览(368)

我想用 HBase 我的scala项目中的api,但尝试时出现错误:

import org.apache.hadoop.hbase

错误是“object hbase不是org.apache.hadoop包的成员”
我正在使用SBT1.3.12构建我的项目,这是 build.sbt :

scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
  "org.apache.hadoop" % "hadoop-common" % "2.7.3",
  "org.apache.hadoop" % "hadoop-client" % "2.7.3",
  "org.apache.hbase" % "hbase-common" % "1.2.1",
  "org.apache.hbase" % "hbase-client" % "1.2.1",
  "org.apache.hbase" % "hbase-protocol" % "1.2.1",
  "org.apache.hbase" % "hbase-server" % "1.2.1"
)

你知道怎么解决这个问题吗?

laawzig2

laawzig21#

可能是 val hbaseVersion = 在你的房间中间 build.sbt . 尝试删除它:

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
  "org.apache.hadoop" % "hadoop-common" % "2.7.3",
  "org.apache.hadoop" % "hadoop-client" % "2.7.3",
  "org.apache.hbase" % "hbase-common" % "1.2.1",
  "org.apache.hbase" % "hbase-client" % "1.2.1",
  "org.apache.hbase" % "hbase-protocol" % "1.2.1",
  "org.apache.hbase" % "hbase-server" % "1.2.1"
)

代码在scastie运行。

相关问题