Groovy (i) Environment construction

Source: Internet
Author: User
Tags groovy script
STEP1: Configuring the JDK

Groovy is Java-dependent, so you need to configure the JDK first. Step2: Download Groovy

Download the address, download it and unzip it.

STEP3: Configuring Groovy Environment Variables

Create a new groovy_home with a value of the path you just unzipped.

Modify path, append%groovy_home%\bin at the end

STEP4: Testing

On the command line, use Groovy-v if the print groovy version test instructions are configured successfully.
STEP5: Experience your own editor

Using the Groovyconsole command launches your own editor

Let's write the first line of Groovy code, println "Hello Groovy", and then press CTRL + R to run.

Also if you choose File-save as ... You can save groovy as a groovy file. So groovy's file suffix is groovy. Of course you can also run groovy programs at the command line with groovy Xxx.groovy. Step6: Using IntelliJ idea to edit groovy

The editor that comes with it is so lame, IntelliJ idea can support writing groovy without having to install anything.

Create a new project, select Groovy, and note that you want to select the Project SDK and Groovy Library.

The project name is called Hellogroovy.

Right-click src to create a new groovy file and select Groovy Script.

The filename is also called Hellogroovy good.

or enter Pritnln "Hello Groovy", CTRL + SHIFT + F10 run.

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.