小编raf*_*000的帖子

Gradle'错误:包com.google.common.collect不存在'

我正在关注一个小测试脚本并为其提供第一段代码以使其变为绿色.代码是java,测试与java混在一起.Java是Mac OSX"El Capitan"上的版本"1.8.0_60".gradle是版本2.8.

使用后gradle build,显示的错误如下:

$ gradle build
:compileJava
/Users/rsalazar/exercism/java/etl/src/main/java/Etl.java:1: error: package  com.google.common.collect does not exist
import com.google.common.collect.ImmutableMap;
                            ^
/Users/rsalazar/exercism/java/etl/src/main/java/Etl.java:9: error: cannot find symbol
    return ImmutableMap.of("a", 1);
           ^
  symbol:   variable ImmutableMap
  location: class Etl
2 errors
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with …
Run Code Online (Sandbox Code Playgroud)

java testing gradle

3
推荐指数
1
解决办法
6948
查看次数

标签 统计

gradle ×1

java ×1

testing ×1