Getting started with La Clojure on Windows
This guide takes you step by step through creating a La Clojure project using IntelliJ IDEA, La Clojure and Leiningen plugins.
- You are working with IntelliJ IDEA Community Edition or Ultimate Edition version 12 or higher.
- Leiningen is installed on your computer.
Creating a Leiningen project
Outside of IntelliJ IDEA, perform the following lein command to create a new lein project:
lein new foobar
The new lein project foobar is created under the directory C:\lein_project:
Open for editing the file project.clj, and specify the desired version of La Clojure:
Installing La Clojure and Leiningen plugins
IntelliJ IDEA starts and displays the Welcome screen, where you click the link Configure:
2. In the Configure page, click the link Plugins:
3. Note that La Closure and Leiningen plugins are not bundled with IntelliJ IDEA. They should be downloaded from the Jetbrains repository and installed. This is how it's done:
In the Plugins dialogs box, click the button Browse repositories, to show the list of repository plugins.
Find the La Clojure plugin, download and install it:
Then, same way, download and install the Leiningen plugin.
When both plugins are installed, they appear in the list of available plugins. When you apply changes, IntelliJ IDEA prompts to restart, for the newly installed plugins to take effect:
Opening project in IntelliJ IDEA
On the welcome screen, click Open Project:
Since La Clojure plugin has been installed, IntelliJ IDEA now recognizes the La Clojure projects:
On clicking OK, IntelliJ IDEA opens the new project, and shows its structure in the Project tool window:
Try to run core.clj, and you will immediately get an error message: No jdk for module 'foobar'. So let us define a suitable JDK for the project.
To do that, click the Project Structure button on the main toolbar:
The Project Structure dialog opens the Project page, with the missing JDK. Click New, on the pop-up menu, choose JDK, and then select or preferred JDK on your file system:
Note that JDK you've just added as the project JDK, appears in the SDKs page of the Project Structure dialog. Open the SDKs page to explore the constituents of the selected JDK:
Exploring module dependencies
You see that Leiningen La Clojure version 1.5.1 is added as the module dependency:
You can also observe this library in the tree view of the external libraries in the Project tool window.