After you create a new Java application, you can specify that you would like the application to support Groovy. You will then be able to code in Groovy, compile Groovy files, and ensure that the IDE excludes the Groovy source files from the JAR that it creates when the project is built.
To enable a Java application to support Groovy:
The IDE adds the Groovy JAR to your application, which you can see in the application's Libraries node. The build.xml file is changed and Groovy files will be excluded when you build the application.