“比较方法违反了其一般合同!”当试图安装Eclipse插件 [英] "Comparison method violates its general contract!" when trying to install Eclipse plugin

查看:246
本文介绍了“比较方法违反了其一般合同!”当试图安装Eclipse插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下系统:

$ cat /etc/redhat-release 
Scientific Linux release 6.1 (Carbon)
$ uname -a
Linux wcmisdlin02.uftmasterad.org 2.6.32-279.9.1.el6.x86_64 #1 SMP Tue Sep 25 14:55:44 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux
$ 

我有以下包

$ rpm -qa | grep ^eclipse
eclipse-emf-2.6.0-1.el6.x86_64
eclipse-svnkit-1.3.0-3.el6.x86_64
eclipse-swt-3.6.1-6.13.el6.x86_64
eclipse-rcp-3.6.1-6.13.el6.x86_64
eclipse-rse-3.2-1.el6.x86_64
eclipse-jdt-3.6.1-6.13.el6.x86_64
eclipse-pde-3.6.1-6.13.el6.x86_64
eclipse-platform-3.6.1-6.13.el6.x86_64
eclipse-subclipse-1.6.5-6.el6.x86_64
$

每当我尝试通过Eclipse安装PDT时, m获取以下错误:

Whenever I'm trying to install PDT through Eclipse I'm getting following error:

An error occurred while collecting items to be installed
session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Comparison method violates its general contract!
Comparison method violates its general contract!

*更新*

$ rpm -qa | grep ^java
java-1.6.0-openjdk-javadoc-1.6.0.0-1.49.1.11.4.el6_3.x86_64
java-1.6.0-openjdk-1.6.0.0-1.49.1.11.4.el6_3.x86_64
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
java-1.6.0-openjdk-devel-1.6.0.0-1.49.1.11.4.el6_3.x86_64
java_cup-0.10k-5.el6.x86_64
java-1.7.0-openjdk-1.7.0.5-2.2.1.el6_3.3.x86_64
$ 

我也发现这个:

$ sudo grep java-1.7.0 /var/log/yum.log
Sep 21 12:46:33 Installed: 1:java-1.7.0-openjdk-1.7.0.5-2.2.1.el6_3.3.x86_64
$ 


推荐答案

这可能是几个月前遇到的已知的Eclipse bug 。这个问题与JDK 7中 Arrays.sort()的新实现有关。

This might be the known Eclipse bug I encountered a few month ago. The problem is related to a new implementation of Arrays.sort() in JDK 7.

如果是这样的错误,您需要安装较新版本的Eclipse,因为该错误阻止您更新(从Eclipse中)。

If it is this bug, you need to install a newer version of Eclipse since the bug prevents you from updating (from within Eclipse).

或者,您可以尝试使用系统属性启动Eclipse java.util.Arrays.useLegacyMergeSort = true 然后更新Eclipse平台。

Alternatively, you may try starting Eclipse with the system property java.util.Arrays.useLegacyMergeSort=true and then update the Eclipse platform.

这篇关于“比较方法违反了其一般合同!”当试图安装Eclipse插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆