Groovy

From GeilThings

Jump to: navigation, search
Groovy
General
Version 2.1.6
Stable 2.1.6
Function Programming Language
Scripts

Contents

General

Installation Groovy

# Installing Groovy: http://groovy.codehaus.org/Installing+Groovy
 
RAWNEWVERSION=`curl -sd "action=ask&query=[[Groovy]]|%3FStable&format=json" http://www.geilthings.com/api.php` 
NEWVERSION=`echo "$RAWNEWVERSION" | grep -Po '^.*?\K(?<=Stable\":\[\").*?(?=\")'`  
echo $NEWVERSION
 
cd /opt
wget http://dist.groovy.codehaus.org/distributions/groovy-binary-${NEWVERSION}.zip
unzip groovy-binary-${NEWVERSION}.zip
# The directory groovy-xxx will be created.
ln -s groovy-${NEWVERSION} /opt/groovy
 
# In /home/username/.bashrc, or /etc/profile, add
export GROOVY_HOME=/opt/groovy
export PATH=$GROOVY_HOME/bin:$PATH
 
# Test.
groovysh
# Quit with exit.

Upgrade Groovy

  • Started with 1.8.5.
APPNAME=groovy
 
RAWOLDVERSION=`groovysh -version`
OLDVERSION=${RAWOLDVERSION:13}
echo ${OLDVERSION}
 
RAWNEWVERSION=`curl -sd "action=ask&query=[[Groovy]]|%3FStable&format=json" http://www.geilthings.com/api.php` 
NEWVERSION=`echo "$RAWNEWVERSION" | grep -Po '^.*?\K(?<=Stable\":\[\").*?(?=\")'`  
echo $NEWVERSION
 
cd /opt
wget http://dist.groovy.codehaus.org/distributions/groovy-binary-${NEWVERSION}.zip
unzip groovy-binary-${NEWVERSION}.zip
# The directory groovy-xxx will be created.
 
# Modify the Groovy soft link.
rm -f /opt/groovy
ln -s /opt/groovy-${NEWVERSION} /opt/groovy
 
# Check version.
groovysh -version
 
# Test.
groovysh
# Quit with exit.
 
mv /opt/groovy-${OLDVERSION} /opt/old_groovy-${OLDVERSION}

Issues

End-of-central-directory signature not found

Solution: Zip file is corrupt, another download link has to be used,

http://dist.groovy.codehaus.org/distributions/groovy210/groovy-binary-2.1.0.zip.

unzip groovy-binary-${NEWVERSION}.zip                      
Archive:  groovy-binary-2.1.0.zip
End-of-central-directory signature not found.  Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive.  In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of groovy-binary-2.1.0.zip or
groovy-binary-2.1.0.zip.zip, and cannot find groovy-binary-2.1.0.zip.ZIP, period.

Versions

Software name Version number Version date
Groovy 2.1.0-beta-1
2.1.0-rc-1
2.1.0-rc-2
2.1.0
2.1.1
2.1.2
2.1.3
2.1.5
2.1.6
26 December 2012
11 January 2013
19 January 2013
26 January 2013
15 February 2013
19 March 2013
27 April 2013
22 June 2013
28 July 2013

Comments

blog comments powered by Disqus