Yes, this is the problem:
public class ClosureBuilder {
cfg = new Config();
...
}
At the top level of a class, you can only have:
- Instance initializer blocks (
{ ... }
)
- Static initializer blocks (
static { ... }
)
- Variable declarations
- Constructor declarations
- Method declarations
- Nested type declarations
- Finalizer declarations
This is none of these. If you meant to declare a variable, you should have done so:
private Config cfg = new Config();
If that's not what you intended to do, you should explain your intention.
EDIT: Once you've fixed that, this compiler error seems pretty clear:
class Config is public, should be declared in a file named Config.java
There are two potential fixes for this:
- Make
Config
non-public
- Move it to a file called
Config.java
Either should fix that error (potentially revealing more).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…