I've installed Ubuntu on my VM and I've got a problem with Grails installation. I've installed JDK, Groovy and downloaded package with Grails. I've added path for java, Groovy and Grails in files /etc/bash.bashrc and ~/.profile.
When I run command 'grails' it gives an error "no command grails found". How can I check what is wrong?
Thanks in advance!
#Dave hinted the answer in a comment but explicitly the answer is to add $GRAILS_HOME/bin to your PATH in the ~/.profile file. $GRAILS_HOME should of course be replaced with the actual location of the Grails installation.
You may also need to chmod +x $GRAILS_HOME\bin\grails.
Related
The jenkins service does not start when ever i run jenkins service start . It says
Starting Jenkins bash: /usr/bin/java: No such file or directory
[FAILED]
I have java installed at /usr/lib/jvm/jdk1.7.0_51. The JAVA_HOME variable is also set. Also tried adding this java to /etc/init.d/jenkins file. I need to use the sun jdk, not open jdk.
Tried some of the alternatives from stackoverflow as well but did not work out.
Any suggestions will be of great help.
Thanks,
Bhargav
Thanks Paul. The script inside /etc/sysconfig/jenkins needs to be edited. Else it uses the default java.
JENKINS_JAVA_CMD="path of java installation"
Along with the above script, one can make changes to /etc/init.d/jenkins file if needed to add the path of java installation in your system.
I'd guess that there's a script that has /usr/bin/java hardcoded. When you find the culprit, remove the /usr/bin so that it uses the default. Or you can change it to use the JAVA_HOME path, something like this:
JAVA_EXECUTABLE=$JAVA_HOME/bin/java
$JAVA_EXECUTABLE $JAVA_OPTS etc.. etc..
Hi i installed grails at
c:/grails
directory on my windows 7
after that i created GRAILS_HOME environment variable as mentioned on grails website
but now when i run this command
grails integrate-with --intellij
on command prompt it throws an error :
grails is not recognized as an internal or external command
any thoughts what i am doing wrong here
I have faced the same problem and did as follows to get rid off.
Although you have already mentioned that, you set Environment variables. I am assuring again:
In environment variables dialogue: (user variables section)
1. Set GRAILS_HOME to your extracted grails version as GRAILS_HOME=D:\GrailsEnvironment\grails-2.1.1
2. Set JAVA_HOME to your installed jdk version as JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
In environment variables dialogue: (System variables section)
1. Edit path and add D:\GrailsEnvironment\grails-2.1.1\bin
2. Edit path and add C:\Program Files\Java\jdk1.7.0_04\bin
If needed reboot your pc again. and in command prompt run 'grails -version' and 'java -version' command to check whether grails and java were perfectly installed.
If error shows then may be your grails package is corrupted, Extract your grails package newly in the specified path again. run the command to check. if necessary reboot and run command.
Thanks
When I'm trying run below code,
D:\apache-tomcat\bin>service.bat install
I got this error.
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
How could I solve this ?
I have found answer for my question. I should add,
set JAVA_HOME=<JAVA INSTALLED Location>
just before set "CURRENT_DIR=%cd%" in service.bat file locate in bin directory in tomcat installed directory.
You need to define environment variable JAVA_HOME and point it to java installed location.
or
you can add below line in in TOMCAT_HOME\bin\startup.bat
set 'JAVA_HOME=<JAVA INSTALLED Location>'
2.If JDK is not installed in your machine, define JRE_HOME and point to installed JRE
I am trying to install grails in my windows 7, I have installed JDK 1.7.0 and downloaded grails from its site and extracted in path "C:\grails", i have jdk in "C:\Program Files\Java\jdk1.7.0". I have set environment variable JAVA_HOME = "C:\Program Files\Java\jdk1.7.0\bin" and GRAILS_HOME = "C:\grails" and added "%GRAILS_HOME%\bin" and JAVA_HOME to path from advanced settings. But when i try to run "grails -v" or "grails help" i get the error "The system cannot find the path specified.". I even changed my directory to "C:\grails" and ran "grails -v" but it is still giving me the same error.
I dont know what is wrong with it, please help me installing this thing.
Thanks
JAVA_HOME = "C:\Program Files\Java\jdk1.7.0\bin" mustn't include 'bin'
You'll want to verify that Java is working correctly first by entering "java -version" at the command line.
When you say you extracted the zip into "C:\grails" does that directory now just have a single sub directory (i.e. "grails-2.5.0" or whatever version you downloaded), or does it contain a bunch of sub directories (bin, conf, dist, doc. etc)?
If the answer is the former, your GRAILS_HOME should point to "C:\grails\grails-2.5.0" instead of just C:\grails\
As I can run multiple versions of groovy / grails without having to change settings?
GVM (Groovy enVironment Manager) is a great option if you're on Mac, Linux, Solaris, or Windows with Cygwin. GVM supports the installation and management of Groovy, Grails, Griffon, and Gradle.
If Grails is your primary concern and you use a Windows PC in a locked down enterprise where Cygwin isn't an option, look at Gravy or write a batch file as noted above.
It's only about GROOVY_HOME/GRAILS_HOME and PATH environment variables. Start your Grails application from a bat file/shell script which sets these two variables, and you're fine.
Grails distinguishes settings stored in home/.grails for different versions, so versions won't clash there.
If you're on linux or osx, theres a shell script here which might help, and an alternative script is here
I am using 7 grails version on my ubuntu machine . put the code below at the bottom of .bashrc file.
function switchGrails() {
echo “Switching to grails version: $1″
sudo rm /opt/grails
sudo ln -s /opt/$1 /opt/grails
echo “Done!”
}
alias grails225=’switchGrails “grails-2.2.5″‘
alias grails224=’switchGrails “grails-2.2.4″‘
alias grails223=’switchGrails “grails-2.2.3″‘
alias grails233=’switchGrails “grails-2.3.3″‘
alias grails235=’switchGrails “grails-2.3.5″‘
alias grails237=’switchGrails “grails-2.3.7″‘
alias grails2311=’switchGrails “grails-2.3.11″‘
After save and exit . Compile the .bashrc file . Type cd and . .bashrc to compile .bashrc file.
For more reference : https://pkashyap28.wordpress.com/2014/09/11/manage-multiple-grails-application-in-ubuntu/
Add a tip if you are working on Windows: there's a way for quick-changing version of GRAILS. You just need to change GRAILS_HOME & GROOVY_HOME (by script, GUI,...) then CLOSE the cmd window used to run grais-app, then start it again. By this way, the change will be applied and you can avoid restarting.
Following the #tim_yates' answer. (unix based OS).
1- Put all grails versions under opt folder:
/opt/grails-2.3.1
/opt/grails-2.5.3
/opt/grails-3.1.1
2- Download and save grails.sh in somewhere you know. (I put mine at /opt/grails-selector)
Edit your ~/.bash_profile file. The PATH var should point to the folder you put your grails.sh. And set GRAILS_HOME to your default version (in case you are creating a new project, for example, it'll use this default version unless you declare to use another.
export PATH=$PATH:/opt/grails-selector
export GRAILS_HOME=/opt/grails-3.1.9
4- You're good to go. May you need to reopen your terminal or logout-login. When you call grails it will calls the grails.sh and then it looks for the version set in your project. So you it works automatically.