“Syntax error on token ”module“, interface expected”

半城伤御伤魂 提交于 2021-01-29 00:35:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!