简体   繁体   English

在Java 7上运行的Eclipse Indigo没有显示对方法的不明确引用

[英]Eclipse Indigo running on Java 7 does not show ambiguous references to methods

I have an application that used to run on Java 1.5. 我有一个曾经在Java 1.5上运行的应用程序。 It compiled and ran well. 它编译运行良好。 Recently, I've decided to migrate to Java 1.7. 最近,我决定迁移到Java 1.7。

When I compile the code with Maven (I updated the Java version in the pom.xml), it displays several compilation errors, saying somes references to some methods are ambiguous, which is true. 当我使用Maven编译代码时(我在pom.xml中更新了Java版本),它显示了一些编译错误,这表明对某些方法的某些引用是模棱两可的,这是事实。 However, on Eclipse, those errors are not shown (I have also updated the compiler of Eclipse to 1.7). 但是,在Eclipse上,这些错误未显示(我还将Eclipse的编译器更新为1.7)。

A friend of mine tried to do the same thing on Eclipse Juno and the errors are showing. 我的一个朋友试图在Eclipse Juno上做同样的事情,并且显示错误。

Any ideas how to fix that? 任何想法如何解决?

Thanks 谢谢

This problem is because the Eclipse thinks that your project is stil on java 1.5. 该问题是因为Eclipse认为您的项目在Java 1.5上仍然存在。

  1. You need to go to Project -> Properties -> Java Buildpath -> Libraries and remove the old Jre. 您需要转到Project-> Properties-> Java Buildpath-> Libraries并删除旧的Jre。
  2. You need to go to Project -> Properties -> Java Buildpath -> Libraries -> Add Library -> Add JRE System Library and ad the new Jre 7 library. 您需要转到Project-> Properties-> Java Buildpath-> Libraries-> Add Library-> Add JRE System Library并添加新的Jre 7库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM