目录:
- 概述
- 安装配置
- 基本应用
[一]、概述
GVM是用于管理大多数基于Unix系统上的多个并行版本的软件开发工具包的一个工具。它提供了一个的命令行界面可以方便快捷地安装,切换,删除和查看各个版本。
它的作用和Ruby的RVM很相似。目前GVM可以运行再如下平台:
- Linux
- Mac OSX
- Cygwin
- Solaris
- FreeBSD (with bash installed)
更多信息参见官网:http://gvmtool.net/
[二]、安装配置
ps:本文是在 Mac OSX 10.8.3的系统上安装演示的
打开终端输入如下命令:
1 |
curl -s get.gvmtool.net | bash |
回车正常会看到如下信息:
123456789101112131415161718192021222324252627282930313233343536373839404142434445 micmiu-mbp:~ micmiu$ curl -s get.gvmtool.net | bashThanks for using_____/\\\\\\\\\\\\__/\\\________/\\\__/\\\\____________/\\\\____/\\\//////////__\/\\\_______\/\\\_\/\\\\\\________/\\\\\\___/\\\_____________\//\\\______/\\\__\/\\\//\\\____/\\\//\\\__\/\\\____/\\\\\\\__\//\\\____/\\\___\/\\\\///\\\/\\\/_\/\\\__\/\\\___\/////\\\___\//\\\__/\\\____\/\\\__\///\\\/___\/\\\__\/\\\_______\/\\\____\//\\\/\\\_____\/\\\____\///_____\/\\\__\/\\\_______\/\\\_____\//\\\\\______\/\\\_____________\/\\\__\//\\\\\\\\\\\\/_______\//\\\_______\/\\\_____________\/\\\___\////////////__________\///________\///______________\///__Will now attempt installing...Looking for a previous installation of GVM...Looking for unzip...Looking for curl...Looking for sed...Installing gvm scripts...Create distribution directories...Create candidate directories...Prime the config file...Download script archive...Extract script archive...Install scripts...Make init script executable...Attempt update of bash profiles...Updated existing /Users/micmiu/.profileCreated and initialised /Users/micmiu/.bashrcAttempt update of zsh profiles...Created and initialised /Users/micmiu/.zshrcAll done!Please open a new terminal, or run the following in the existing one:source "/Users/micmiu/.gvm/bin/gvm-init.sh"Then issue the following command:gvm helpEnjoy!!!
安装后,重新打开一个终端输入如下命令验证是否安装成功:
1 |
gvm help |
安装成功,回车会看到如下信息:
123456789 micmiu-mbp:~ micmiu$ gvm helpUsage: gvm <command> <candidate> [version]command : install, uninstall, list, use, current, version, default, selfupdate, broadcast or helpcandidate : groovy, grails, griffon, gradle, lazybones, vertxversion : optional, defaults to latest stable if not providedeg: gvm install groovy
[三]、基本应用
1. install 命令
安装当前默认groovy版本只需输入如下命令:
1 |
gvm install groovy |
回车安装完成显示如下信息:
123456789101112131415 micmiu-mbp:~ micmiu$ gvm install groovyDownloading: groovy 2.1.3% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 27.2M 100 27.2M 0 0 41617 0 0:11:25 0:11:25 --:--:-- 83111Installing: groovy 2.1.3Done installing!Do you want groovy 2.1.3 to be set as default? (Y/n): YSetting groovy 2.1.3 as default.
如果需要安装指定版本的groovy ,只需要输入:
1 |
gvm install groovy 2.0.0 |
2. use 命令
切换到指定版本命令如下:
1 |
gvm use groovy 2.1.3 |
3. default 命令
设定默认版本命令如下:
1 |
gvm default groovy 2.1.3 |
4. current 命令
查看当前所有的软件配置:
1 |
gvm current |
查看到当前指定软件的配置:
1 |
gvm current groovy |
5. list 命令
查看软件所有的版本清单:
1 |
gvm list groovy |
6. Uninstall 命令
卸载指定版本的软件:
1 |
gvm uninstall groovy 2.0.0 |
7. version 命令
查看当前gvm的版本:
1 |
gvm version |
本文介绍到此结束@Michael Sun.
原创文章,转载请注明: 转载自micmiu – 软件开发+生活点滴[ http://www.micmiu.com/ ]
本文链接地址: http://www.micmiu.com/lang/groovy/gvm-groovy-environment-manager/
0 条评论。