安装gradle 2.11显示为1.10

时间:2016-03-04 09:13:04

标签: ubuntu gradle

我正在尝试在我的ubuntu机器上安装Gradle,但是当我安装并试图检查它的版本时它会说1.10而不是2.11

我使用以下命令安装:

$  sudo apt-get install gradle
[sudo] password for ser: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  gradle
0 upgraded, 1 newly installed, 0 to remove and 159 not upgraded.
Need to get 0 B/2,554 B of archives.
After this operation, 26.6 kB of additional disk space will be used.
Selecting previously unselected package gradle.
(Reading database ... 880324 files and directories currently installed.)
Preparing to unpack .../gradle_2.11-0ubuntu1_all.deb ...
Unpacking gradle (2.11-0ubuntu1) ...
Setting up gradle (2.11-0ubuntu1) ...

但版本说它是1.10

$ gradle -version

------------------------------------------------------------
Gradle 1.10
------------------------------------------------------------

Build time:   2013-12-17 09:28:15 UTC
Build number: none
Revision:     36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_55 (Oracle Corporation 24.55-b03)
OS:           Linux 3.13.0-77-generic amd64

如何解决此问题。

我尝试删除gradle并重新安装,但同样的问题。

sudo apt-get remove gradle

1 个答案:

答案 0 :(得分:2)

我有同样的问题。看看

/usr/lib/gradle

如果您看到多个版本文件夹,则必须手动删除每个文件夹,如

sudo apt-get remove --auto-remove gradle-1.10

然后你可以正常安装gradle。