{"kb_content":{"id":"454","title_id":"12","parent_id":"453","content_type":"text","name":"Step 1: Grails Installation, Running and Debugging an application","alias":"step-1-grails-installation-running-and-debugging-an-application","title":"Step 1: Grails Installation, Running and Debugging an application","intro":"","content":"

Before installing Grails 3.x you will need as a minimum a Java Development Kit (JDK) installed version 1.7 or above. Download the appropriate JDK for your operating system, run the installer, and then set up an environment variable called JAVA_HOME pointing to the location of this installation.<\/p>

export JAVA_HOME=\/Library\/Java\/Home\nexport PATH=\"$PATH:$JAVA_HOME\/bin\"\n<\/pre>

On Windows you would have to configure these environment variables in My Computer\/Advanced\/Environment Variables<\/p>

For manual installation follow these steps:<\/span><\/p>

\u00b7       Download<\/a> a binary distribution of Grails and extract the resulting zip file to a location of your choice<\/span><\/p>

\u00b7       Set the GRAILS_HOME environment variable to the location where you extracted the zip<\/span><\/p>

o  On Unix\/Linux based systems this is typically a matter of adding something like the following <\/span>export GRAILS_HOME=\/path\/to\/grails<\/code> to your profile<\/span><\/p>

o  On Windows this is typically a matter of setting an environment variable under <\/span>My Computer\/Advanced\/Environment Variables<\/code><\/p>

\u00b7       Then add the <\/span>bin<\/code> directory to your <\/span>PATH<\/code> variable:<\/span><\/p>

o  On Unix\/Linux based systems this can be done by adding <\/span>export PATH=\"$PATH:$GRAILS_HOME\/bin\"<\/code> to your profile<\/span><\/p>

o  On Windows this is done by modifying the <\/span>Path<\/code> environment variable under <\/span>My Computer\/Advanced\/Environment Variables<\/code><\/p>

If Grails is working correctly you should now be able to type <\/span>grails -version<\/code> in the terminal window and see output similar to this:<\/span><\/p>

Grails version: 3.2.10\n<\/pre>


<\/p>

You have familiar with Composer and need to install Composer. If not, please see https:\/\/getcomposer.org and install composer. After installing composer, go to your htdocs folder and open terminal and run the command To create a Grails application you first need to familiarize yourself with the usage of the grails<\/code> command which is used in the following manner:<\/p>

grails <<command name>>\n<\/pre>

Run create-app<\/a> to create an application:<\/p>

grails create-app helloworld\n   \n<\/pre>


<\/p>

Running and Debugging an Application<\/h4>

 Improve this doc<\/p>

Grails applications can be run with the built in Tomcat server using the run-app<\/a> command which will load a server on port 8080 by default:<\/p>

grails run-app\n<\/pre>

You can specify a different port by using the -port<\/code> argument:<\/p>

grails run-app -port=8090\nWhen you run the app, it will view in the browse with http:\/\/localhost:8090 URL. \nIf you want run again, that time, you need to stop with port as like \ngrails stop-app -port=8090\nand execute run command. \n<\/pre>

For more http:\/\/docs.grails.org\/latest\/guide\/gettingStarted.html<\/p>


<\/p>


<\/p>","summery":"","references":"","featured_image":null,"video_url":"","sort_order":"9","created":"2021-07-02 18:37:45","updated":null,"has_content":null},"code":200}