Installing Apache Groovy On Ubuntu 20.04 LTS Step by Step

On this short guide we will discuss how to install Apache Groovy on Ubuntu 20.04 LTS by using SDKMAN. 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.

Introduction

If we are a Java developer who’s going to develop an applications, We hope if there are tools that can help us to speed up application development, easily integrate with other java program. Feature rich which is inspired by any languages like Python, Ruby and Smalltalk while maintaining the strength of Java. Apache Groovy can be an answer.

Apache Groovy can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. In this article we will learn how to install Apache Groovy on Ubuntu 20.04 LTS operating system.

There are several steps to install Apache Groovy, it will be explained below.

  • Prerequisite
  • Installing Apache Groovy
  • Verifying Apache Groovy





Prerequisite

To use Apache Groovy properly, we need to Java installed on our system, either the official Oracle JDK or Open JDK. For this tutorial, we’re going to be install OpenJDK. We will verify Java installed on our system by querying its version.

$ java –version

The output will be as shown below :

ramans@bckinfo:~$ java –version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

The second thing to have is curl, if we don’t have curl installed on our system, then install it first. To verify curl installed on our system, we will use command line :

$ curl –version

The output will be as shown below :

ramans@bckinfo:~$ curl –version
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

Installing Apache Groovy Using SDKMAN

Groovy installation by using SDKMAN option has grown quickly in popularity, and makes managing multiple versions of Groovy very simple. Here is the following instruction.

$ curl -s get.sdkman.io | bash

The output will be shown below :

ramans@bckinfo:~$ curl -s 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...
Download script archive...
######################################################################## 100.0%
Extract script archive...
Install scripts...
Set version to 5.9.0+555 ...
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!

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!!!

After SDKMAN installation was completed done, then we just install Groovy by submitting command line :

$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install groovy

Verifying Groovy Installation

Then verity Groovy by using command line :

$ groovy -version

The output will be shown below :

ramans@bckinfo:~$ groovy -version
Groovy Version: 3.0.5 JVM: 11.0.8 Vendor: Ubuntu OS: Linux

Until this stage, Groovy has been installed on our system completedly.

Conclusion

We have installed Apache Groovy on Ubuntu 20.04 LTS successfully.

Add a Comment

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