为了开发JavaFX应用程序,我使用了eclipse的4.3.1快照和JDK 8 build b116.在我的工作区项目中,构建路径中的JRE库包含始终重置为Java 1.4:

不幸的是,这只能暂时修复(直到下一次eclipse重启):

在我的pom文件的构建部分,我有:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<debug>true</debug>
<debuglevel>source,lines</debuglevel>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我很欣赏一个不太灵活的解决方案.
[更新]这个问题似乎与当前版本的问题有关
我的班级标题:
public class GraphEdge implements Comparable<GraphEdge>{
/** Node from which this edge starts*/
protected Point from;
/** Node to which this edge goes*/
protected Point to;
/** Label or cost for this edge*/
protected int cost;
Run Code Online (Sandbox Code Playgroud)
我的compareTo方法:
@Override
public int compareTo(GraphEdge other){
return this.cost-other.cost;
}
Run Code Online (Sandbox Code Playgroud)
但是Eclipse给了我错误:
GraphEdge类型的compareTo(GraphEdge)方法必须覆盖超类方法
whyyyyy?我尝试过做Comparable,用
@Override
public int compareTo(Object o){
GraphEdge other = (GraphEdge) o;
return this.cost-other.cost;
}
Run Code Online (Sandbox Code Playgroud)
但这也失败了.