Groovy logo

Image: Groovy Logo, The Apache Software Foundation, Apache License 2.0

A colleague of mine recently asked me to install the Groovy programming language on our Red Hat 6.5 server and to make it accessible to all users. I thought it would be a very straightforward task but a quick search on the Red Hat 6.5 official repositories didn’t return any package for Groovy.

The easiest way to install Groovy manually is via sdkman. I followed this procedure to do it:

  1. Make sure you have Java installed by running:

    java -version
    

    If you don’t have Java, follow these instructions to install the default JRE/JDK or Oracle JDK.

  2. Install sdkman and set it up:

    curl -s "https://get.sdkman.io" | bash
    source "/home/cirulls/.sdkman/bin/sdkman-init.sh"
    

    WARNING: it’s not a security best practice to install software with commands such as curl -s "https://get.sdkman.io" | bash. However, that’s the way sdkman recommends to be installed on its website. In this case always inspect the content of the script you downloaded before running the bash command to install it.

  3. Check that sdkman is correctly installed:

    sdk version
    
  4. Install groovy:

    sdk install groovy
    
  5. Check that groovy is correctly installed:

    groovy -version
    

Happy grooving!