- Groovy 2 Cookbook
- Andrey Adamovich Luciano Fiandesio
- 448字
- 2021-07-23 15:57:18
Installing Groovy on Windows
In this recipe, we will provide instructions on installing the Groovy distribution on the Windows operating system.
Getting ready
The requirement for installing Groovy 2.0 is JDK 1.5 and higher. We assume that you have JDK installed and know how to use Java. In case you use JDK 7 or later, then you can take advantage of the dynamic language optimization present in that version. For instance, the invokedynamic
bytecode instruction (see the Running Groovy with invokedynamic support recipe).
To install Groovy on Windows, you need to download the ZIP distribution from http://groovy.codehaus.org/Download.
The latest major version at the time of writing is 2.1.6. The latest minor version is 2.0.8. Since v2.0, Groovy has changed the release version numbering, so the next major version of Groovy will be 3.0 and the next minor versions will have the second digit increased (2.1, 2.2, 2.3, and so on).
Alternatively, you can build Groovy from the source distribution which is described in the Building Groovy from source recipe.
How to do it…
After downloading the zipped distribution, you need to unzip the archive to a directory of your choice and carry out the following steps to install Groovy on Windows:
- For simplicity, we will assume that the directory is
C:\Applications\groovy-2.0
. The contents of the directory should look as shown in the following screenshot: - In order to have the
groovy
command available on your command line, you need to add it to your system's path by setting the environment variable namedPATH
. We also advise you to create aGROOVY_HOME
variable for simpler reference. - To access the Windows environment variables, you need to press the Windows + Break key combination. On Windows Vista, Windows 7, or later, it will open the Control Panel page for system settings.
- Click on Advanced system settings to open the System Properties window.
- Then you need to click on the Environment Variables... button to finally get to the list of the system variables.
- Click on the New... button and add the
GROOVY_HOME
variable pointing to your Groovy installation path: - Then find the
Path
variable in the list of system variables and append or insert the%GROOVY_HOME%\bin;
string to it: - You can now fire the Windows command line and verify that Groovy is installed correctly by issuing the
groovy --version
command:
If you get the output displayed as in the previous screenshot, your Groovy installation is complete.
There's more...
As an alternative to the zipped archive, Windows users can also download a one-click installer (you can find the link on the same download page under the Download Windows-Installer link). Execute the installer and follow the instructions to get a fully functional Groovy installation.
- Advanced Quantitative Finance with C++
- Node.js+Webpack開發實戰
- Spring 5.0 Microservices(Second Edition)
- Spring Cloud Alibaba核心技術與實戰案例
- Web開發的貴族:ASP.NET 3.5+SQL Server 2008
- 數據結構簡明教程(第2版)微課版
- GeoServer Beginner's Guide(Second Edition)
- TradeStation交易應用實踐:量化方法構建贏家策略(原書第2版)
- Mastering JavaScript High Performance
- C++程序設計
- Python機器學習與量化投資
- Python編程基礎教程
- 關系數據庫與SQL Server 2012(第3版)
- Zend Framework 2 Cookbook
- Swift Essentials(Second Edition)