我正在尝试在 Eclipse 中安装 optaplanner 示例。我遇到了一些我无法解决的问题:
Software:
Eclipse luna
jdk 1.8
maven 1.6
我也GIT
为这个项目使用了软件。
主要问题出在ConferenceSchedulingXslxFileIO
java类上。
错误是:
The method getLeft() is undefined for the type Talk
The method getLeft() is undefined for the type Talk
The method getRight() is undefined for the type Object
The method getRight() is undefined for the type Object
The method getRight() is undefined for the type Object
The method getRight() is undefined for the type Talk
The method nextTalkListCell(Iterable<Object>) in the
The type Pair does not define getLeft(Object) that is applicable here
The type Pair does not define getLeft(Object) that is applicable here
任何人都可以帮忙吗?
我怀疑您的 IDE 的 java 语言设置可能太低了。它应该设置为至少与 java 8 兼容。请注意,java 语言设置与使用的 JDK 不同(当然,JDK 也至少需要为 8)。
getLeft() 和 getRight() 仅用于Pair
实例。因此,除非您更改源,否则以某种方式无法确定某些变量是 Pair 类型,而只是认为它是一个对象。最近的 Java 语言版本中缺乏泛型支持或泛型类型改进可能可以解释这一点。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句