Logic
Logic

Reputation: 2258

grails commands not working in terminal

I'm new to Groovy on Grails development. I downloaded GGTS bundle and started to work on that.

My environment variables echo $JAVA_HOME gives /usr/lib/jvm/default-java/bin and echo $GRAILS_HOME gives /home/pc-03/Desktop/ggts-bundle/grails-2.4.4/bin

when I try to create new application in GGTS I'm able to create it, but when the same is done through terminal it just blinks.

When I try grails create-app sample the terminal just blinks and doesn't create a new app.

Can anyone explain why this is happening so ??

Thanks in advance !!!

Upvotes: 2

Views: 4154

Answers (2)

kanishk joshi
kanishk joshi

Reputation: 1

An addition to @Frederic's answer.

  1. Add JAVA_HOME and Grails Home Path:

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
    export export GRAILS_HOME="/home/pc-03/Desktop/ggts-bundle/grails-2.4.4"
    
  2. Reinstall Grails:

    sdk uninstall grails 
    sdk install grails 
    

While installing Grails, the JAVA_HOME environment variable should be present.

Upvotes: 0

Frederic Henri
Frederic Henri

Reputation: 53753

Fix your variables to

$JAVA_HOME="/usr/lib/jvm/default-java"
$GRAILS_HOME="/home/pc-03/Desktop/ggts-bundle/grails-2.4.4"

you do not need the bin directory -

but then you should add the $GRAILS_HOME/bin in your $PATH variable to call grails command from any places on your computer

Upvotes: 5

Related Questions