how to install groovy on ubuntu 22.04
how to install groovy on ubuntu 22.04

How To Install Apache Groovy On Ubuntu 22.04 (Jammy Jellyfish)

In this short tutorial we will learn how to install Apache Groovy on Ubuntu 22.04 Linux operating system. Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. For this tutorial, will use Apache Groovy version 4.0.6 which was provided at Apache Groovy official website.

Apache Groovy can be used as both a programming language and a scripting language. It integrates smoothly with any Java program, and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.

Installing Apache Groovy 4.0.6 on Ubuntu 22.04

In this tutorial we will install Apache Groovy by using SDKMAN.

Prerequisites

Before we start to install Apache Groovy, there are several prerequisites that must be met so that the installation process can run smoothly. We will need to prepare any requirements as mention below :

  • an Ubuntu 22.04 system
  • a non-root user with sudo privileges
  • sufficient disk and good internet access

Apache Groovy 4.0 requires Java 8+ with support for up to Java 16 to run properly on the system. We will ensure the java has been installed on the system by querying its version. If there is no java installed on our system then we must install it before continuing the next process.

$ java -version

Output :

ramans@infodiginet:~$ java --version
openjdk 11.0.17 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)

We have had java 11.0.17 installed on the system.

The Apache Groovy installation will be consist of several steps as follow :

  1. Update Ubuntu System
  2. Install SDKMAN
  3. Install Apache Groovy
  4. Verify Groovy Version

The detailed tasks will be explained in the sub-chapter below.

1. Update Ubuntu System

The first step of Apache Groovy installation is to update local packages software. We will use command line :

$ sudo apt update
$ sudo apt upgrade

2. Install SDKMAN

The Groovy installation on this tutorial, will be done through SDKAMAN, so we need to first install this software development kit manager by submitting command line :

$ sudo curl -s "https://get.sdkman.io" | bash

Output :

ramans@infodiginet:~$ sudo curl -s "https://get.sdkman.io" | bash

                                -+syyyyyyys:
                            `/yho:`       -yd.
                         `/yh/`             +m.
                       .oho.                 hy                          .`
                     .sh/`                   :N`                `-/o`  `+dyyo:.
                   .yh:`                     `M-          `-/osysoym  :hs` `-+sys:      hhyssssssssy+
                 .sh:`                       `N:          ms/-``  yy.yh-      -hy.    `.N-````````+N.
               `od/`                         `N-       -/oM-      ddd+`     `sd:     hNNm        -N:
              :do`                           .M.       dMMM-     `ms.      /d+`     `NMMs       `do
            .yy-                             :N`    ```mMMM.      -      -hy.       /MMM:       yh
          `+d+`           `:/oo/`       `-/osyh/ossssssdNMM`           .sh:         yMMN`      /m.
         -dh-           :ymNMMMMy  `-/shmNm-`:N/-.``   `.sN            /N-         `NMMy      .m/
       `oNs`          -hysosmMMMMydmNmds+-.:ohm           :             sd`        :MMM/      yy
      .hN+           /d:    -MMMmhs/-.`   .MMMh   .ss+-                 `yy`       sMMN`     :N.
     :mN/           `N/     `o/-`         :MMMo   +MMMN-         .`      `ds       mMMh      do
    /NN/            `N+....--:/+oooosooo+:sMMM:   hMMMM:        `my       .m+     -MMM+     :N.
   /NMo              -+ooooo+/:-....`...:+hNMN.  `NMMMd`        .MM/       -m:    oMMN.     hs
  -NMd`                                    :mm   -MMMm- .s/     -MMm.       /m-   mMMd     -N.
 `mMM/                                      .-   /MMh. -dMo     -MMMy        od. .MMMs..---yh
 +MMM.                                           sNo`.sNMM+     :MMMM/        sh`+MMMNmNm+++-
 mMMM-                                           /--ohmMMM+     :MMMMm.       `hyymmmdddo
 MMMMh.                  ````                  `-+yy/`yMMM/     :MMMMMy       -sm:.``..-:-.`
 dMMMMmo-.``````..-:/osyhddddho.           `+shdh+.   hMMM:     :MmMMMM/   ./yy/` `:sys+/+sh/
 .dMMMMMMmdddddmmNMMMNNNNNMMMMMs           sNdo-      dMMM-  `-/yd/MMMMm-:sy+.   :hs-      /N`
  `/ymNNNNNNNmmdys+/::----/dMMm:          +m-         mMMM+ohmo/.` sMMMMdo-    .om:       `sh
     `.-----+/.`       `.-+hh/`         `od.          NMMNmds/     `mmy:`     +mMy      `:yy.
           /moyso+//+ossso:.           .yy`          `dy+:`         ..       :MMMN+---/oys:
         /+m:  `.-:::-`               /d+                                    +MMMMMMMNh:`
        +MN/                        -yh.                                     `+hddhy+.
       /MM+                       .sh:
      :NMo                      -sh/
     -NMs                    `/yy:
    .NMy                  `:sh+.
   `mMm`               ./yds-
  `dMMMmyo:-.````.-:oymNy:`
  +NMMMMMMMMMMMMMMMMms:`
    -+shmNMMMNmdy+:`


                                                                 Now attempting installation...


Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Installing script cli archive...
* Downloading...
######################################################################## 100,0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

* Downloading...
######################################################################## 100,0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

Set version to 5.16.0 ...
Set native version to 0.0.15 ...
Attempt update of interactive bash profile on regular UNIX...
Added sdkman init snippet to /home/ramans/.bashrc
Attempt update of zsh profile...
Updated existing /home/ramans/.zshrc




All done!


You are subscribed to the STABLE channel.

Please open a new terminal, or run the following in the existing one:

    source "/home/ramans/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!

Then we will submit source command line to initialize SDKMAN.

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

3. Installing Apache Groovy

After SDKMAN is installed successfully, then we will install groovy by issuing command line :

$ sdk install groovy

Output :

ramans@infodiginet:~$ sdk install groovy
==== BROADCAST =================================================================
* 2022-12-20: vertx 4.3.7 available on SDKMAN!
* 2022-12-20: quarkus 2.13.6.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.13.6.Final
* 2022-12-20: micronaut 3.7.5 available on SDKMAN!
================================================================================

Downloading: groovy 4.0.6

In progress...

############################################################################################################### 100,0%

Installing: groovy 4.0.6
Done installing!


Setting groovy 4.0.6 as default.
Install Groovy using SDKMAN

4. Verify Groovy Installation

After Groovy installation is completedly done, then we will verify it by querying its version, as shown below:

$ groovy -version

Output :

ramans@infodiginet:~$ groovy -version
Groovy Version: 4.0.6 JVM: 11.0.17 Vendor: Ubuntu OS: Linux
Apache Groovy version 4.0.6

Conclusion

In this short tutorial, we have learn how to install Apache Groovy verson 4.0.6 using SDKMAN. I hope it will be helpful.

(Visited 134 times, 1 visits today)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *