java构建路径问题
从某人的项目中,我收到此错误:
Java Build Path Problems (1 item)
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workplace that are strictly compatible with this environment.
我有最新的 JDK (jdk1.6.0_25)。根据我的理解,我可以执行以下操作之一:
- 下载J2SE-1.5环境以匹配项目。
- 编辑项目以符合最新的 JDK。 我该怎么做?
From someone's project, I am getting this error:
Java Build Path Problems (1 item)
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workplace that are strictly compatible with this environment.
I have the latest JDK (jdk1.6.0_25). From my understanding, I can do one of the following:
- Download the J2SE-1.5 environment to match the project.
- Edit the project to agree with the latest JDK. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是对此的一个很好的讨论:
基本上你应该
Here's a good discussion on this:
Basically you should
选择第二个选项,编辑项目以与最新的 JDK 一致,
Go for the second option, Edit the project to agree with the latest JDK
在 Eclipse 的 Package Explorer 中,您可以右键单击项目,选择“构建路径”、“配置构建路径”以获取构建路径对话框。从那里您可以删除 1.5 JRE 的 JRE 引用,并“添加库”以添加对已安装 JRE 的引用。
From the Package Explorer in Eclipse, you can right click the project, choose Build Path, Configure Build Path to get the build path dialog. From there you can remove the JRE reference for the 1.5 JRE and 'Add Library' to add a reference to your installed JRE.
要在 eclipse 中配置 JRE:
To configure your JRE in eclipse:
除了 MahmoudS 的评论之外,也尝试一下这个。
将 pom.xml 中的 maven 编译器源和目标更改为您正在使用的 java 版本。说jdk7为1.7
Try this too in addition to MahmoudS comments.
Change the maven compiler source and target in your pom.xml to the java version which you are using. Say 1.7 for jdk7