Groovy Install,gvm,groovysh Overview

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.