Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

July 14, 2008

Installing Grails in Ubuntu GNU/Linux Using Package Manager

Filed under: GNU/Linux, Groovy/Grails, Ubuntu — tabrez @ 3:21 pm

In my previous post I talked about setting up Grails development environment in GNU/Linux distributions by manually downloading the packages and configuring the environment variables. The main advantage of this method is that you can work with the latest versions of the Groovy and Grails packages available, and in fact, you can work with more than one version of these software at the same time: just point your environment variables to different locations. The procedure is also more or less independent of a particular GNU/Linux distribution.

An easier, alternative way to install Groovy and Grails packages is to use the package management system of your favourite GNU/Linux distribution. The trade-off is that you have to accept the version of the packages that are available in your distribution’s repositories(apt-get) or you may have to compromise with the stability of your system(dpkg). Below I am documenting the procedure to install Grails development environment using package manager tools in Ubuntu 8.04(Hardy Heron).

Installing Sun JDK 6 in Ubuntu 8.04 Using apt-get/aptitude

In Debian/Ubuntu based operating systems installing new packages is as simple as running aptitude command with the package name.

# sudo aptitude install sun-java6-jdk

You also need to set JAVA_HOME environment variable in your preferred profile file(/etc/profile, $HOME/.profile or /etc/environment):

JAVA_HOME=/usr/lib/jvm/java-6-sun

Refer to the first step of previous post in my Grails series if you need more help.

Installing Groovy in Ubuntu 8.04 Using apt-get/aptitude

To install Groovy and its dependency packages, run the following command in a command shell:

# sudo aptitude install groovy

You can also install Groovy from Synaptic Package Manager, simply search for package name called “groovy” in it. But have a look at the version number!

Synaptic Package Manager shows an old version of Groovy package in Ubuntu 8.04 package repository

See what I mean? The latest stable version of Groovy is 1.5.6 though I would recommend using the 1.6 beta 1.

Installing Groovy in Ubuntu 8.04 Using GDebi

If you don’t mind picking up a deb file from a third-party source, Groovy download page has Debian/Ubuntu packages for both 1.5.6 stable version and 1.6 beta 1 version.

Groovy latest stable version for Debian/Ubuntu family of GNU/Linux distributions available as a deb package.

When you download the Ubuntu deb binary from this page Ubuntu will automatically open it using GDebi and install it for you.

Download the Groovy deb package from its download page and install it with GDebi application.

Installing Groovy in Ubuntu 8.04 Using dpkg

You can also save the deb file on your computer and install it from the command shell using the dpkg tool:

# sudo dpkg -i <name-of-the-downloaded-deb-file>

Installing Grails in Ubuntu 8.04 Using apt-get/aptitude

Unfortunately there is no Grails package in Ubuntu official repositories yet. You can try any unofficial repositories for Grails available on the Internet but only if you trust them. An old repository meant for installing Grails 1.0 RC2 on Ubuntu Gutsy was posted on Ubuntu Forums by prach. Have a look at it just as an example, I don’t recommend actually using it. I don’t know of a similar repository for more recent versions of Grails. So better option will be to install the latest deb package of Grails using GDebi or dpkg tools; see the next step.

Installing Grails in Ubuntu 8.04 Using GDebi

You can follow the above procedure(Step 2(b)) used for Groovy to install Grails too, by downloading its deb package from Grails’s download page.

Download the Groovy deb package from its download page and install it with GDebi application.

Then choose to open the package with GDebi installer.

Download the Grails deb package from its download page and install it with GDebi application.

Installing Grails in Ubuntu 8.04 Using dpkg

You can also save the deb file on your computer and install it from the command shell using the dpkg tool:

# sudo dpkg -i <name-of-the-downloaded-deb-file>
You can now go to the post where I show how to create a basic “Hello, World” Grails application to test your Grails configuration. (You can ignore the first step of that post.)

Summary:
To summarize, you can install Sun JDK, Groovy and Grails packages in Debian/Ubuntu family of distributions using simple commands, like this:

# sudo aptitude install sun-java6-jdk
# sudo echo ‘JAVA_HOME=/usr/lib/jvm/java-6-sun’ >> /etc/profile
# wget http://dist.codehaus.org/groovy/distributions/installers/deb/groovy-1.6-beta-1.deb
# sudo dpkg -i groovy-1.6-beta-1.deb
# wget http://ant-deb-task.googlecode.com/files/grails_1.0.3-1_all.deb
# sudo dpkg -i grails_1.0.3-1_all.deb

You can use similar commands/tools for other GNU/Linux distributions, like yum in Fedora, yast in openSUSE, emerge in Gentoo, etc. All the above download links point to the latest versions at the time of this writing, so remember to change them appropriately when updated versions are released.


If you want to receive future posts by email, enter your email address here:

Related Posts:

2 Comments »

[...] is also an easy way to setup Grails development environment using the package managers of different GNU/Linux distributions. Like installing Groovy and Grails [...]

Quote

Pingback by Setting Up Development Environment For Grails on GNU/Linux — July 14, 2008 @ 3:22 pm

Hi,

How about being aggregated on UbuntuWeblogs.org? Get in touch if you’re interested.

Quote

Comment by Tiago Faria — July 14, 2008 @ 6:06 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Subscribe without commenting


Copyright (c) 2006, 2007 Tabrez Iqbal.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


Powered by WordPress
This website is hosted by Dreamhost


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics