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.