how to create grails project through windows command promt - grails

How to create Grails project through windows command prompt?
In Grails Documents it says to use Posh-GVM.But i want to know how to use Posh_GVM.

Make sure the JDK is properly installed and JAVA_HOME environment variable is defined. To make sure your JDK is installed, you can open a command prompt and enter
java -version
Make sure appropriate Grails files as downloaded and GRAILS_HOME environment variable is defined. To make sure Grails is installed, you can open a command prompt and enter
grails -version
Once you have successfully installed JDK and Grails, go to the folder where you want to create your Grails app and type
grails
create-app com.example.yourappname

I have consider that you have set JAVA_HOME && GRAILS HOME
Then check for JAVA_HOME && GRAILS_HOME
Type this into your command prompt :
JAVA -version
then check for
GRAILS_HOME
If both are shown their version else you reset your ENVIRONMENT variable again.
If you want create grails app through command prompt :
Go to cmd prompt :
create directory using following command:
mkdir grails_app
Then go to grails_app directory following command:
cd grails_app
Then,
Type following command to create the grails application in using command prompt:
grails create-app helloworld
Here,
helloworld - Name of grails application
For more details you can use following document :
http://docs.grails.org/2.4.4/guide/gettingStarted.html#creatingAnApplication
Hope this will help you create grails app through command prompt

Related

After installation of Hyperon not able to browse http://localhost:38080/hyperon/app

I have installed Hyperon a business rule engine on windows machine.
I have fallowed instruction to install it from:
- https://www.hyperon.io/tutorial/installing-hyperon-studio
After installation I have browse below URL to see whether #Hyperon web app is running or not.
http://localhost:38080/hyperon/app
I am getting this error:
Error Screenshot
Reproduceable Steps:
Downloaded hyperon zip and extracted it.
Open the file directory and reach to the /bin folder
Opened it in command prompt:
Ran startup.bat file.
Refer to below screenshot:
command prompt logs
tomcat command prompt logs and output after executing- startup.bat
Such effect occurs when trying to run hyperon with JDK 8.
Hyperon Studio requires JDK 11.
See installation guide:
https://www.hyperon.io/tutorial/installing-hyperon-studio
If you have multiple JDKs installed, you can swith to proper by setting JAVA_HOME variable:
for example:
cd c:\hyperon-studio-2.1.9\bin
set JAVA_HOME=c:\java\jdk-11.0.4
startup.bat
The first run may take a minute, because hyperon needs to initialize database schema.
Once it is fully started you will see hyperon.log file and should be able to access localhost:38080/hyperon/app.

grails is not recognized as an internal or external command

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

Grails installation

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\

Grails installation on Virtual Machine Ubuntu

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.

How to run multiple Groovy/Grails version

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.

Resources