& quot;令牌上的语法错误& quot;模块& amp ;;预期的接口& quot; [英] "Syntax error on token "module", interface expected"

查看:101
本文介绍了& quot;令牌上的语法错误& quot;模块& amp ;;预期的接口& quot;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这段代码为我提供了错误消息:令牌模块"上的语法错误,预期接口.有人知道为什么吗?

this bit of code gives me the error message: "Syntax error on token "module", interface expected. Does anyone know why?

module TeaThiever{
}

推荐答案

module 语句仅在 module-info.java 文件中有效,并且必须使用Java 9或更高版本.

The module statement is only valid in a module-info.java file and it must be used with Java 9 or above.

在Eclipse中,将项目"Java编译器"属性页上的编译器符合级别"设置为Java 9或更高版本(您还需要安装合适的Java).

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).

这篇关于& quot;令牌上的语法错误& quot;模块& amp ;;预期的接口& quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆