LoginSignup
5
5

More than 5 years have passed since last update.

CygwinでGVM使ってGradleをインストールする

Posted at

CygwinでGVM経由でGradle入れるのにハマったのでメモ。
Oracleを入れている人はもしかしたら同じ事象に遭遇するかも。

GVM インストール

$ curl -s get.gvmtool.net | bash

プロキシ環境下で実行する場合は、以下を参考にhttp_proxy(小文字)に注意して設定する。
proxy環境下でGVMを入れる(続き) - ごずろぐ

Gradle インストール

バージョン指定しない場合、最新の安定版がインストールされる。

$ gvm install gradle

Downloading: gradle 2.2.1

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   356    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 55.8M  100 55.8M    0     0  7805k      0  0:00:07  0:00:07 --:--:-- 11.2M

Installing: gradle 2.2.1
Done installing!

Do you want gradle 2.2.1 to be set as default? (Y/n): Y

Setting gradle 2.2.1 as default.

バージョン確認っと。

$ gradle -v

------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------

Build time:   2014-11-24 09:45:35 UTC
Build number: none
Revision:     6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.7.0_51 (Oracle Corporation 24.51-b03)
OS:           Windows 7 6.1 amd64

エラーが出た場合

すんなりインストール出来ればいいけど、以下のようなエラーが出たらzip,unzipのパスを確認する。

$ gvm install gradle

Downloading: gradle 2.2.1

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   356    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 55.8M  100 55.8M    0     0  7855k      0  0:00:07  0:00:07 --:--:-- 12.0M
unzip:  cannot find either /cygdrive/c/Users/tenten0213/.gvm/archives/gradle-2.2.1.zip or /cygdrive/c/Users/tenten0213/.gvm/archives/gradle-2.2.1.zip.zip.

Stop! The archive was corrupt and has been removed! Please try installing again.

Oracleのzip,unzipコマンドに向いちゃってる。

$ which zip
/cygdrive/c/oraclexe/app/oracle/product/11.2.0/server/bin/zip
$ which unzip
/cygdrive/c/oraclexe/app/oracle/product/11.2.0/server/bin/unzip

パスを修正するか、(コマンドを持っていなければ)apt-cygでzip,unzipをインストールすれば解決する。

$ apt-cyg install zip
$ apt-cyg install unzip
$ which zip
/usr/bin/zip
$ which unzip
/usr/bin/unzip
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5