Upgrading Groovy

This post is mainly a note to my self. At work I use a Linux Mint distro, but the bundled version of groovy is 1.7.10 and I needed some stuff only present in 2.0.0, thus I had to upgrade. I’m not that into linux (or any other OS for that matter), so it took me a while to figure out how. Then my computer crashed and I had to do it over, but I had not made any notes during my previous attempt. Luckily Google was my friend and I was able to find out quite quickly. This will be my notes now:

First download groovy 2.0.0 from http://groovy.codehaus.org/Download

Then, in a command prompt, execute the following

# cd /usr/lib/
# sudo unzip /groovy-binary-2.0.0.zip
# sudo update-alternatives --install "/usr/bin/groovy" "groovy" "/usr/lib/groovy-2.0.0/bin/groovy" 1
# sudo update-alternatives --install "/usr/bin/groovyc" "groovyc" "/usr/lib/groovy-2.0.0/bin/groovyc" 1
# sudo update-alternatives --install "/usr/bin/groovyConsole" "groovyConsole" "/usr/lib/groovy-2.0.0/bin/groovyConsole" 1
# sudo update-alternatives --install "/usr/bin/groovysh" "groovysh" "/usr/lib/groovy-2.0.0/bin/groovysh" 1
# sudo update-alternatives --install "/usr/bin/java2groovy" "java2groovy" "/usr/lib/groovy-2.0.0/bin/java2groovy" 1
# sudo update-alternatives --config groovy

Test that everything went well

# groovy -v
Groovy Version: 2.0.0 JVM: 1.6.0_26 Vendor: Sun Microsystems Inc. OS: Linux

(use google for details about “sudo” and “update-alternatives”)

Advertisements