Groovy for Domain-specific Languages - Second Edition

(nextflipdebug2) #1
Chapter 2

[ 23 ]

If you are the latter, then GVM has got to be your best reason yet for giving Cygwin
a spin. You can install Cygwin by running the setup program from the following
address: http://cygwin.com/install.html. Pick the setup program appropriate to
your system, either 32-bit or 64-bit. Cygwin does not install all packages by default,
so at the end of the installation process, you will need to pick curl from the Net
package category and unzip from the Archive category.


From the directory where you installed Cygwin, you can now launch the Cygwin
command prompt using the Cygwin.bat command file:


C:\cygwin\Cygwin.bat


Fergal@mypc ~


You can now issue the curl command we used earlier to install GVM in your
Cygwin session.


Cygwin will pick up all your Windows environment and path variables.
GVM itself depends on there being a valid JDK available and will look
first for JAVA_HOME and then for the javac command executable to
determine where this is. Make sure you have a properly configured JDK
in your path somewhere. You can download and install the latest JDK
from http://www.oracle.com/technetwork/java/javase/
downloads/index.html.

How to find and install Groovy from binaries


The Groovy project is hosted at http://www.groovy-lang.org/download.html
and can be downloaded as a ZIP archive or a platform-specific installer for Windows
and certain Linux distributions. At the time of writing this book, the latest version of
the language available is Groovy 2.4.4.


In five simple steps, you can run Groovy and start experimenting with the language:



  1. Download the latest build from
    http://www.groovy-lang.org/download.html.

  2. Unzip the archive into a directory on your computer.

  3. Set an environment variable in your command line or shell for GROOVY_HOME.
    This should point to the base directory to which you unzipped the archive.

Free download pdf