Blogg
Här finns tekniska artiklar, presentationer och nyheter om arkitektur och systemutveckling. Håll dig uppdaterad, följ oss på LinkedIn
Här finns tekniska artiklar, presentationer och nyheter om arkitektur och systemutveckling. Håll dig uppdaterad, följ oss på LinkedIn
This article covers how to setup your standard Eclipse environment with plugins from SpringSource for developing Groovy and Grails applications without using the full SpringSource Tool Suite.
It is more and more common that we see other languages than Java running on the JVM. One such language is Groovy which together with the Ruby on Rails inspired framework Grails forms a good platform for rapid development of simple web applications.
SpringSource Tool Suite is an extended Eclipse with support for a lot of interesting things. There’s is good support for developing Groovy and Grails applications in the SpringSource Tool Suite IDE, easy to setup via the built-in extension mechanism which is available in the Extensions tab on the STS Dashboard.
If however, we are interested in developing Groovy and Grails applications and don’t care so much about all the other stuff that SpringSource Tool Suite is packaging it is possible to pick out only the plug-ins that we need from the SpringSource Tool Suite and apply them to a clean Eclipse version.
This article presents a way of setting up a development environment for Groovy and Grails inside Eclipse.
Some of the functionalities in the Grails framework requires you to have a JDK installed.
Make sure that you have a JDK of version J2SE 1.6 installed and that your JAVA_HOME
environment variable points to the JDK and that Eclipse uses it on the build path of your projects, otherwise follow the instructions below.
JAVA_HOME
environment variable exists and points at your installed JDK JAVA_HOME="c:\Program Files\Java\jdk1.6.0_23"
c:\Program Files\Java\jdk1.6.0_23
)We will start with a clean version of Eclipse 3.6.1 from Eclipse’s download page and install the plug-ins we need.
To make the plug-ins work we also need to download the Grails framework.
c:\tools
GRAILS_HOME
that points to your Grails installation folder (Not mandatory when running Grails inside Eclipse) GRAILS_HOME=c:\tools\grails-1.3.6
PATH
environment variable to point at ${GRAILS_HOME}\bin
(Not mandatory when running Grails inside Eclipse) PATH=%PATH%;%GRAILS_HOME%\bin
c:\tools\grails-1.3.6
Your Eclipse environment is now ready for developing Groovy and Grails applications.
Follow these steps to perform a simple test to see that Groovy now works inside Eclipse. As a side effect you also get a shortcut to a great tool for trying out groovy scripts, the Groovy Console.
You should now have a Grails perspective in Eclipse.
GroovyConsole.groovy
and insert the following code:import groovy.ui.Console
def console = new Console()
console.run()
Right click GroovyConsole.groovy
and click on Run As/Groovy Script
For more information about the technologies and tools used in this article there is more to read on these locations: