How to install Groovy on Ubuntu, Linux Mint and other similar distros

A short tutorial how to install Groovy on Ubuntu, Linux Mint and other similar distros.

Download lastest Groovy build @ http://groovy.codehaus.org/Download and upack it

First create a groovy folder in /usr/lib

sudo mkdir /usr/lib/groovy

Then move the unpacked groovy folder to it

sudo mv groovy-1.8.6/ /usr/lib/groovy/

Our next step is to use update-alternatives to add a group of alternatives to the system

sudo update-alternatives --install "/usr/bin/groovy" "groovy" "/usr/lib/groovy/groovy-1.8.6/bin/groovy" 1
sudo update-alternatives --install "/usr/bin/groovyc" "groovyc" "/usr/lib/groovy/groovy-1.8.6/bin/groovyc" 1
sudo update-alternatives --install "/usr/bin/groovyConsole" "groovyConsole" "/usr/lib/groovy/groovy-1.8.6/bin/groovyConsole" 1
sudo update-alternatives --install "/usr/bin/groovysh" "groovysh" "/usr/lib/groovy/groovy-1.8.6/bin/groovysh" 1
sudo update-alternatives --install "/usr/bin/java2groovy" "java2groovy" "/usr/lib/groovy/groovy-1.8.6/bin/java2groovy" 1

Then to check if everything is fine:

sudo update-alternatives --config groovy

and finally

groovy -v

should give you:

Groovy Version: 1.8.6 JVM: 1.6.0_27 Vendor: Sun Microsystems Inc. OS: Linux

Lastly try groovyConsole for evaluating your Groovy script:

groovyConsole

ps. I used this tutorial how to install oracle java 7 as a basis for this one 🙂

Ta-dah! you’re done 🙂

One thought on “How to install Groovy on Ubuntu, Linux Mint and other similar distros

  1. Pingback: Gettin Groovy…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s