问题
this bit of code gives me the error message: "Syntax error on token "module", interface expected. Does anyone know why?
module TeaThiever{
}
回答1:
The module
statement is only valid in a module-info.java
file and it must be used with Java 9 or above.
In Eclipse set the 'Compiler compliance level' on the project 'Java Compiler' properties page to be Java 9 or above (you also need to have a suitable Java installed).
来源:https://stackoverflow.com/questions/62129181/syntax-error-on-token-module-interface-expected