当我尝试使用具有以下类的 groovy-eclipse 编译器编译我的项目时:
import groovy.transform.builder.Builder
// @author: m on 10.05.16 22:15.
@Builder
class F {
int a
}
和
public class B {
int a;
public static void main(String[] args) {
F.FBuilder builder = F.builder();
F build = builder.a(1).build();
}
}
出现以下错误:
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/m/git_repo/mix/src/main/java/B.java:[7,1] 1. ERROR in /Users/m/git_repo/mix/src/main/java/B.java (at line 7)
F.FBuilder builder = F.builder();
^^^^^^^^^^
F.FBuilder cannot be resolved to a type
[ERROR] /Users/m/git_repo/mix/src/main/java/B.java:[7,24] 2. ERROR in /Users/m/git_repo/mix/src/main/java/B.java (at line 7)
F.FBuilder builder = F.builder();
^^^^^^^
The method builder() is undefined for the type F
[ERROR] Found 2 errors and 0 warnings.
如何解决?请帮忙