July 2015
Intermediate to advanced
284 pages
5h 41m
English
We have discussed what Groovy is and some of its important features. Let us create a Hello World program and feel the magic with Groovy. Here we are assuming that Groovy is installed on the system, GROOVY_HOME is pointing to the installation directory and <GROOVY_HOME>/bin has been added to the PATH environment variable:
file: GroovyTest.groovy println "Hello Groovy"
And that's all. Yes, for a simple Groovy program, you don't need to declare any packaging, any main class, or any semicolons, only a simple println statement would create your first Groovy program.
To execute the program, use the following command:
$ groovy GroovyTest.groovy Hello Groovy
The groovy command is used to execute the Groovy script. The beauty ...
Read now
Unlock full access