clojure Getting started with clojure Create a new application

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

After following the instructions above and installing Leiningen, start a new project by running:

lein new <project-name>

This will setup a Clojure project with the default Leiningen template within the <project-name> folder. There are several templates for Leiningen, which affect the project's structure. Most commonly is the template "app" used, which adds a main-function and prepares the project to be packed into a jar-file (which the main-function being the entrypoint of the application). This can be achieved with this by running:

lein new app <project-name> 

Assuming you used the app-template to create a new application, you can test that everything was setup correctly, by entering the created directory and running the application using:

lein run

If you see Hello, World! on your console, you're all set and ready to start building your application.

You can pack this simple application into two jar-files with the following command:

lein uberjar


Got any clojure Question?