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
Clojure Documentation
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
Colour
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
Undo
Redo
Keyboard Shortcuts Help
<h2>Pre-requisites</h2><ul><li><strong>Java 6</strong> (for running Eclipse, you can still use Java 5 for your projects)</li></ul><h2>Install Eclipse<sup><em><br /></em></sup></h2><p><em>(If you do not have Eclipse installed, or you want to make isolated tests of the Clojure plugin for Eclipse)</em></p><ul><li>Grab the Eclipse ZIP file from <a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a> . If you do not know which "package" to get, pick the "Eclipse IDE for Java Developers" one since it ships out of the box with Git support</li><li>Unzip it somewhere. The executable is eclipse (linux) or eclipse.exe (windows) located in the eclipse/ directory created by the unzip operation</li><li>The first time Eclipse is run, it will ask you for a location on your disk where eclipse will put its metadata and will create new projects by default.</li></ul><h2>Install Counterclockwise (the Clojure plugin for Eclipse)</h2><p><em>(<strong>C</strong>ounter<strong>c</strong>lock<strong>w</strong>ise, <strong>CCW</strong> for short, is the Clojure plugin for Eclipse)</em></p><p>You install it via the “software update center”, that is:</p><ul><li>Menu Help > Install new software…</li><li>Paste the following Counterclockwise url in the “Work with:” textbox: <a href="http://ccw.cgrand.net/updatesite/">http://ccw.cgrand.net/updatesite/</a> , Hit Enter</li><li>Select counterclockwise, verify the “Contact all update sites during …” chekbox is checked, click next, accept licence, etc., restart Eclipse</li><li>Go to menu Window > Reset Perspective ... this will reset the way the views are layout, and also place correctly the views contributed by Counterclockwise (the Namespace Browser view, placed "behind" the code outline view)</li></ul><h2>Test the install<sup><em><br /></em></sup></h2><p><em>Create and run a simple Clojure project ("Hello Betty")</em></p><ul><li><strong>Open the Java perspective</strong><ul><li>Window > Open Perspective > Java (a perspective is a predefined layout of views, suitable for a particular type of development)</li></ul></li><li><strong>Create a Clojure project</strong> <br /><ul><li>With Leiningen Project Wizard: File > New > Leiningen Project, name it myproject</li><li>The project is created using the "default" Leiningen Template, which creates a Clojure project with a predefined "myproject.core" namespace in src/myproject/core.clj</li></ul></li><li><strong>Add a function definition</strong> to myproject.core: <br /><ul><li>Open src/myproject/core.clj, add the following at the end: (defn hello [who] (str "Hello " who " !")), save the file</li></ul></li><li><strong>Run the project:</strong> <br /><ul><li>With file src/myproject/core.clj open, Hit Ctrl+Alt+S (Cmd+Alt+S on MacOS). This sends the whole file's code to the REPL (and also takes care of starting a REPL for the project if none is currently started)</li></ul></li><li><strong>Switch to the REPL</strong> in the namespace of your file: <br /><ul><li>Hit Ctrl+Alt+N (Cmd+Alt+N on MacOS). Alternatively, just click on the bottom of the REPL inside the "text input area"</li></ul></li><li><p><strong>Call your function</strong> (Hit Enter to send the expression if the cursor is at the end, or hit Ctrl+Enter / Cmd+Enter if the cursor is not at the end of the text):</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>> 1:1 helloworld=> (hello "Betty") [Ctrl+Enter] > "Hello Betty !" </pre></td></tr></table></li></ul>
Attachments
Labels
Location
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced