Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p><table class="wysiwyg-macro" data-macro-name="unmigrated-inline-wiki-markup" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtaW5saW5lLXdpa2ktbWFya3VwOmF0bGFzc2lhbi1tYWNyby1vdXRwdXQtdHlwZT1CTE9DS30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>{table-plus:borderStyle=none|width=999px|enableSorting=false|columnAttributes=style="borderStyle:none;",style="borderStyle:none;"} |{panel:borderStyle=none|titleBGColor=#99cc66|bgColor=#99cc66}*TUTORIAL OVERVIEW* \\ &nbsp;&nbsp;&nbsp;*Task* - Create a Groovy project in Eclipse. \\ &nbsp;&nbsp;&nbsp;*Level* - Basic. The task is simple if you have created a Java project in Eclipse. \\ &nbsp;&nbsp;&nbsp;*Prerequisites* - GroovyEclipse v2.0, Eclipse 3.4.2, 3.5, or 3.5.1. {panel}|{panel:borderStyle=none| titleBGColor=#ff6666| bgColor=#ff6666} *ALL GROOVY-ECLIPSE TUTORIALS* \\ &nbsp;&nbsp;&nbsp;[Install Groovy-Eclipse Plugin] \\ &nbsp;&nbsp;&nbsp;Create Your First Groovy Project{panel} | {table-plus}</pre></td></tr></table></p> <p><table class="wysiwyg-macro" data-macro-name="unmigrated-inline-wiki-markup" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtaW5saW5lLXdpa2ktbWFya3VwOmF0bGFzc2lhbi1tYWNyby1vdXRwdXQtdHlwZT1CTE9DS30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>{table-plus:borderStyle=none|width=999px|enableSorting=false|bgColor=#ffff99|columnAttributes=style="borderStyle:none;"} |*QUICK FACTS FOR EXPERIENCED ECLIPSE USERS* \\ Create a Groovy project in Eclipse the same way you do a Java project, but use the Groovy wizards -- *File > New > Groovy Project* and *File > New > Groovy Class* -- instead of the Java equivalents.| {table-plus}</pre></td></tr></table></p> <p><strong>NOTE</strong>: In this tutorial, the Groovy-Eclipse plugin is running on Eclipse 3.5.1. The user interface and task flow may vary somewhat in Eclipse 3.4.2.</p> <p><span style="color: blue;"><strong>GETTING HELP</strong></span> <span style="color: blue;">– If you have problems, send a message to</span> <span style="color: blue;"><a href="http://xircles.codehaus.org/lists/eclipse-plugin-user@groovy.codehaus.org">http://xircles.codehaus.org/lists/eclipse-plugin-user@groovy.codehaus.org</a></span><span style="color: blue;">.</span></p> <p><table class="wysiwyg-macro" data-macro-name="unmigrated-inline-wiki-markup" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtaW5saW5lLXdpa2ktbWFya3VwOmF0bGFzc2lhbi1tYWNyby1vdXRwdXQtdHlwZT1CTE9DS30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>{table-plus:autoNumber=true|border=2|highlightColor=#6699CC|width=999px|enableSorting=false|columnAttributes=style="width:30%; border:1;",style="width:70%; border:1;"} || Do || See || |In Eclipse, click *File > New > Groovy Project*.\\{quote}If *Groovy Project* does not appear in the drop-down list, then select *Other* and search for *Groovy Project* in the dialog box.{quote} |!FileNewGroovyProject.jpg!| |In the *New Groovy Project* wizard, type a name in the *Project Name* box, and click *Next*. \\ \\ {quote}GroovyEclipse creates the project and a folder structure for it. A folder with the same name as the project appears in the Package Explorer. The project directory contains a {{src}} and a {{bin}} folder, each empty.{quote}|!NewGroovyProject.png!| |The tabs and options in the *Build Settings* window are identical to those in the the Java Development Tool (JDT). \\ \\ Click *Finish* to proceed without customizing the build settings. \\ \\ {quote}For information about build options, see Eclipse help for the *New Java Project Wizard*; it applies to Groovy projects as well.{quote} |!BuildSettings.png!| |Select the project in the Package Explorer, and click *File > New > Groovy Class*.|!GroovyClassA.png!| |In the *Groovy Class* wizard, type a name for the class in the *Name* box, a name for the package in the *Package* field, and click *Finish* to create the class and package. \\ \\ {quote}If you type the name of an existing package in the *Package* field, the class is created there. \\ \\ Just like in the JDT, you can create a package as a separate step with *File > New > Package*, or when you use the create the first class{quote}|!CreateANewGroovyClass.png!| |GroovyEclipse creates the new class. The new class, {{Greetings.groovy}} in this example, is listed in the Package Explorer, and opened in the editor. \\ \\ {quote}Note that, as generated by GroovyEclipse {{Greetings.groovy}} already contains the package statement and class declaration.{quote} |!ClassCreatedA.png!| |Paste this code into the file: \\ \\ {{static void main(def args) \{}} \\ &nbsp;&nbsp; {{def mygreeting = "Hello World"}} \\ &nbsp;&nbsp; {{println mygreeting}} \\ {{\}}} |!CodeAddedA.png!| |Right click anywhere in the editor and then *Run > Run As > Groovy Script* or *Java Application*.\\ {quote}Running as an _Application_ will launch the compiled *.class files, whereas running as a _Script_ will launch the uncompiled *.groovy files. In general, the results will be the same, but there are some subtle differences between the two.{quote}|!RunRunAs.png!| |The greeting is issued in the *Console* tab. |!GreetingIssuedA.png!| {table-plus}</pre></td></tr></table></p> <table class="wysiwyg-macro" data-macro-name="column" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvbHVtbn0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p /></td></tr></table> <table class="wysiwyg-macro" data-macro-name="section" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3NlY3Rpb259&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p /></td></tr></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced