I am a novice, who is new to Linux and I am trying to set GROOVY_HOME environment variable. Note sure if this is the right step:


Also trying to add $GROOVY_HOME/bin to my $PATH environment variable, but I am not too sure on how to do this. Any ideas/steps on what to do would be appreciated.

  • How you installed groovy? via .deb file or how?
    – Ashu
    Oct 8, 2016 at 20:59
  • I have the groovy binary distribution on a local file system, which i copied across to the local file system on the target server in Ubuntu -- /usr/share/groovy...
    – Don Ontime
    Oct 8, 2016 at 21:11

1 Answer 1


Create the file /etc/profile.d/groovy.sh by opening a terminal window and running this command:

sudo -H gedit /etc/profile.d/groovy.sh

Give the file this contents:

export GROOVY_HOME=/usr/share/groovy

Then save, log out and log in again.

  • Thanks. Can you please tell me the steps to create the file -- /etc/profile.d/groovy.sh
    – Don Ontime
    Oct 8, 2016 at 21:19
  • @DonOntime: I just did, I think. Run the command I suggested. Oct 8, 2016 at 21:21
  • I have just tried the above step, but do encounter this: Sudo:unable to change to root gid: operation not permitted and also sudo: unable to initialise policy plug-in
    – Don Ontime
    Oct 10, 2016 at 8:17
  • @DonOntime: I assumed you were logged in as a user with admin privileges. If you are logged in as root you can skip the sudo -H part. Otherwise you need to switch to an admin user account. Oct 10, 2016 at 8:26
  • @kaviranga: ??? Jul 20, 2020 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .