为什么通过命令行而不是Intellij出现“不是软件包的成员”和“找不到类”错误?

时间:2018-10-29 10:57:30

标签: scala hadoop intellij-idea sbt

我有一个Scala测试,该测试可以在Intellij中使用,但不能在使用命令行的终端中使用。代码+错误:

[error] ... object Configuration is not a member of package org.apache.hadoop.conf
[error] ... object FileSystem is not a member of package org.apache.hadoop.fs
[error] import org.apache.hadoop.fs.{FileSystem, FileUtil, Path}
[error]        ^
[error] ... Class org.apache.hadoop.ha.ServiceFailedException not found - continuing with a stub.
[error]       val hdfsCluster = new MiniDFSCluster.Builder(conf).build()
[error]                             ^
[error] ... not found: type Configuration
[error]       val conf = new Configuration()
[error]                      ^
[error] ... not found: value FileUtil
[error]       FileUtil.fullyDelete(baseDir)
[error]       ^
[error] ... not found: value FileSystem
[error]       val hdfs = FileSystem.get(conf);
[error]                  ^
[error] ... not found: value FileUtil
[error]       FileUtil.fullyDelete(baseDir);
[error]       ^
[error] ... not found: type Configuration
[error]       val conf = new Configuration();
[error]                      ^
[error] ... not found: value FileUtil

Sbt依赖项:

"org.apache.hadoop" % "hadoop-hdfs" % "2.6.5" % Test classifier "tests",
"org.apache.hadoop" % "hadoop-common" % "2.6.5" % Test classifier "tests"

0 个答案:

没有答案