groovy安装

确认你电脑已经安装jdk

groovy官网:http://groovy.codehaus.org/

 

我下载的是压缩版

 

  1. 将Groovy压缩包解压到指定目录(我的是D:\aaSoftware\groovy-binary-1.8.6\groovy-1.8.6)。注意:Groovy的安装路径不能有空格, 否则会出错。
  2. 设置环境变量groovy_home,新增环境变量,变量名:groovy_home、变量值:groovy的解压目录。
  3. 设置path,编辑path,在变量值后面添加%groovy_home%\bin 。
  4. 测试配置成功.在命令行中输: groovy -v //查看groovy的当前版本。
运行hello.groovy
我在d盘下新建: hello.groovy
println "hello, world"  
  
for (arg in this.args ) {  
  println "Argument:" + arg;  
}  
  
在命令行输入:
D:\groovy> groovy hello.groovy aa bb cc   
显示结果:
  1. D:\groovy>groovy hello.groovy aa bb cc  
  2. hello, world  
  3. Argument:aa  
  4. Argument:bb  
  5. Argument:cc  

还可以进入 groovyConsole窗口
在命令行输入:“ groovyConsole”之后打开控制台窗口,键入“println 'hello world'”之后ctrl+R,输出了“hello world”。
-----------------------------------------------------------------------------------------------------------------------------
离线安装:我下载最新的archive-2.6.0.xx-20111212-0900-e37-RELEASE.zip
  1. Download the snapshot locally
  2. Do not unzip or move into your dropins directory
  3. Start eclipse
  4. Help -> Install new software -> Add...
  5. Select the location of the zip you just downloaded
  6. Install as you would from the regular update site
在线安装:

Once you have a compatible Eclipse installed, then follow these directions to install Groovy-Eclipse:

  • Go to: Help -> Software Updates.
  • Change to the Available Software tab.
  • Click on Add Site.
  • Paste the update site URL appropriate for your version of Eclipse and click OK.
  • You should see a "Groovy Update Site" entry in the list of update sites. Expand and select the Groovy-Eclipse Plugin feature. Optionally, you can choose to include the sources..
  • Click Install and follow the prompts.
  • Restart when asked
  • Rejoice!  You installed the Groovy-Eclipse Plugin v2.

For step-by-step installation instructions, see the Install Groovy-Eclipse Plugin tutorial.

-----------------------------------------------------------------------------------------------------------------------------
创建一个 Groovy项目

To create a basic Groovy project in Eclipse perform the following steps:

  • Open the Java perspective
  • Click on the new Groovy Project icon: 
  • The new project wizard for Groovy uses most of the same options as the new project wizard for Java.
  • Fill in the appropriate details and create the project.

You should have a src folder and several libraries. A bin folder is also created, but is hidden.

You can create a Groovy classes or test cases using wizards similar to the Eclipse's Java class and JUnit test case wizards. Use the options on the File > New menu or press CTRL-N.

For step-by-step instructions, see the Create Your First Groovy Project tutorial.





附:
http://pleac.sourceforge.net/pleac_groovy/内有大量丰富的样例代码,比如说你正计划编写一个工具来获取Web页面并分析,就能够在这里找到这种样例代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值