Shenoy Tinny
Shenoy Tinny

Reputation: 1335

installing grails in linux

I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.

I was wondering how to have them available for all sessions.

Any help is appreciated

Thanks

Upvotes: 4

Views: 12377

Answers (7)

Sumit Munot
Sumit Munot

Reputation: 3868

Groovy Grails Installation:

Before starting up install JAVA on linux system

Check java version using command

$> java -version

Install grails on Linux using Installing-a-grails-development-environment-on-linux

Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation

After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command

$> grails -version

Check Environment variable is set or not for Java as well as Grails with command

$> printenv 

Create demo application and run the server for Grails using:

$> grails create-app demo

Go to path

$> cd demo/

Run the server

$> grails run-app

Run the server on specific port 9090

$> grails run-app -Dserver.port=9090

Tools and running environment set up for Groovy Grails:

Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool

Select Eclipse package on linux from the above link:

YouTube Video Tutorial:

All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel

Upvotes: 0

Dónal
Dónal

Reputation: 187539

you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)

Update

The best way to install Grails on Linux/Mac is to use GVM.

GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.

In addition to Grails, you can also use GVM to manage your installation of

  • Groovy
  • Griffon
  • Gradle
  • vert.x

Upvotes: 4

Akhilesh
Akhilesh

Reputation: 1410

If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line

GRAILS_HOME=/opt/grails PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"

Upvotes: 0

sonwh98
sonwh98

Reputation: 51

In /etc/profile.d/ create a script name grails.sh:

export GRAILS_HOME=/opt/grails

export PATH=$GRAILS_HOME/bin:$PATH

Change /opt/grails to where you unzipped grails.

This will make it available for all users.

Upvotes: 0

matcauthon
matcauthon

Reputation: 2261

If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:

sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails

Upvotes: 3

Vincent PALITA
Vincent PALITA

Reputation: 166

Edit the .bashrc file of the user launching Grails.

Add the same lines as your commands:

GRAILS_HOME=/home/of/grails

export GRAILS_HOME

PATH=$PATH:$GRAILS_HOME/bin

Upvotes: 15

Mengu
Mengu

Reputation: 524

you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.

Upvotes: 0

Related Questions