1.1 Installing Groovy
Groovy Home: http://www.groovy-lang.org
Ensure that the local system has Java installed
1.1.1 Installing groovy on a Windows system
1. Create the environment variable groovy_home, whose value is Groovy's directory (for example: C:\programs\groovy\groovy-2.1.0).
2. Add the%groovy_home%\bin to the path.
3. Verify that the value of the environment variable java_home is pointing to the location of the JDK.
4. Enter GROOVY-V in the command-line window to ensure that the correct version is being reported.
1.1.2 Installing Groovy on Unix-like systems
1. Edit the ~/.bash_profile file and add an entry: Export groovy_home= '/opt/groovy/groovy-2.1.0 '
2. Add the%groovy_home%/bin to the environment variable path.
3. Verify that the value of the environment variable java_home is pointing to the location of the JDK. (ls-l ' which Java ' This command helps to determine where Java is installed)
4. Enter GROOVY-V in the command-line window to ensure that the correct version is being reported.
1.2 Managing multiple versions of groovy
Download Install GVM (Groovy environment Manager)
To view the available and installed groovy language versions:
GVM List Groovy
Download Install Groovy:
GVM Install Groovy 2.1.1
To switch to a version:
GVM Use Groovy 2.1.1
1.3 Using Groovysh
If the environment variable is already configured, you can enter "Groovysh" in the Command Line window, enter the shell, where you can write groovy code, enter the run, exit the shell please input ": X", Get help Please enter ": H"
1.4 Using Groovyconsole
If you are not accustomed to writing code in the command-line window, you can double-click the Groovyconsole.bat file under%groovy_home%\bin, open the GUI, and in this case you can write graceful code, CTRL + R to run the code.
1.5 Running groovy at the command line
To test a code on the command line you can use the-e option, such as: groovy-e "println ' Hello World '"
1.6 Using the IDE
If you choose the IDE to write code, I recommend using Intelij idea.
Http://www.cnblogs.com/yili-2013/p/Groovy.html
Groovy Install,gvm,groovysh Brief (GO)