首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

groovy装配

2012-08-29 
groovy安装确认你电脑已经安装jdkgroovy官网:http://groovy.codehaus.org/?我下载的是压缩版?将Groovy压缩

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
在命令行输入: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”。-----------------------------------------------------

groovy-eclipse?plugin安装离线安装:我下载最新的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:?groovy装配
  • 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页面并分析,就能够在这里找到这种样例代码

热点排行