Groovy requires Java, so you need to have a version available (while groovy 1.6 supports JDK 1.4 or greater is required, for groovy 1.7 onwards, minimum JDK 1.5 is needed). Here are the steps if you don't already have Java installed:
- Get the latest suitable Java distribution from the http://java.sun.com website.
- Run the installer.
- Set the JAVA_HOME environment variables. On Windows, follow these steps:
- Open the System control panel
- Click the Advanced tab
- Click the Environment Variables button
- Add a new System variable with the name JAVA_HOME and the value of the directory Java was installed in (mine is C:\Program Files\Java\jdk1.5.0_04)
- Optionally add %JAVA_HOME%\bin to your system path
(Note: as an alternative to setting a system environment variable, you can create yourself a '.bat' or '.cmd' file which sets the variable. You then need to run that batch file in any console window in which you wish to run Java and double clicking on '.bat' or '.cmd' files containing Java invocation instructions won't work. If you are unsure about what this means, follow the earlier instructions.)