Java自动装箱

发布于 2024-08-12 04:18:30 字数 122 浏览 2 评论 0原文

我将我正在处理的项目切换到 Maven,突然自动装箱似乎坏了。我的 IDE (NetBeans) 在诸如下面的一行中抱怨错误“不兼容的类型”

Integer order = 4;

I switched a project I'm working on over to maven and suddenly auto boxing seems to have broken. My IDE (NetBeans) complains on lines such as the one below with the error "Incompatible types"

Integer order = 4;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落墨 2024-08-19 04:18:30

检查以确保您仍然使用 1.5 以后的 JDK 进行编译,并且您的兼容性设置也没有调低到 1.5 以下。

Check to ensure you are still compiling with a post-1.5 JDK, and that your compatibility settings are not tuned down below 1.5 either.

云之铃。 2024-08-19 04:18:30

内部编译器(用于编辑器提示)将遵循 POM 中的源设置,以匹配完整 Maven 构建的行为。 Maven 当前默认为 1.3 作为源级别: http://jira.codehaus.org/browse/ MCOMPILER-80 您可以通过编辑 POM 或(更容易地)使用 NetBeans 项目属性对话框来更改源级别。

The internal compiler (used for editor hints) will follow the source settings in the POM, to match the behavior of a full Maven build. Maven currently defaults to 1.3 as a source level: http://jira.codehaus.org/browse/MCOMPILER-80 You can change the source level by editing the POM, or (more easily) using the NetBeans project properties dialog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文