Grails - Environment



There are a variety of ways to get the Grails environment setup.

Binary download and installation − Go to the link https://grails.incubator.apache.org/ to get the zip file. Click on this option to start the download of the Groovy binary distribution.

Download

As Grails is Groovy based, JDK should be installed prior to Grails installation. We're using JDK 19. You can follow Java - Environment Setup to install JDK. For Groovy 6, JDK 11 is the minimum version required.

Install using SDKMAN

Latest version of Grails can be installed using following command.

$ sdk install grails

Manual Installation - Windows

Step 1: Extract file

Extract the downloaded grails-cli-6.2.3.zip file and extract in any suitable folder. We've extracted the zip file in c:/grails directory.

Step 2: Set Environment Variables

Set/Update the environment variables as shown below −

  • GRAILS_HOME − C:\grails\grails-cli-6.2.3

  • PATH − C:\grails\grails-cli-6.2.3\bin

Verify the installation

Open Command Prompt, and check grails version −

C:\> grails --version
Grails Version: 6.2.3
JVM Version: 24.0.1

Manual Installation - Unix/Linux

Step 1: Extract file

Extract the downloaded grails-cli-6.2.3.zip file and extract in any suitable folder. We've extracted the zip file in /etc/grails directory.

Step 2: Set Environment Variables

export GRAILS_HOME=/etc/grails/grails-cli-6.2.3
export PATH="$PATH:$GRAILS_HOME/bin

Verify the installation

Open Command Prompt, and check grails version −

$ etc > grails --version
Grails Version: 6.2.3
JVM Version: 24.0.1

Now as grails is installed successfully, we can create grails based application easily as covered in next chapters.

Advertisements