Clojure is a modern programming language. Depending on your skill level, you can create any type of software with Clojure. This includes games, web apps, mobile apps, and desktop applications.
The first step in programming Clojure is to install it and other things needed for creating Clojure programs.
Most of the Clojure tutorials and Clojure examples on this site require at the minimum Clojure to be installed. Usually, you want Leiningen installed too.
Easy peasy.
Seriously, do it once and ignore it for the rest of your learning experience. Here are the steps for getting Lein and Clojure up and running.
This creates a Clojure web app using the Luminus Framework, Reitit for mapping of incoming requests to the proper handlers, HTTP Kit for HTTP handling, MySQL for JDBC connections to our MySQL database, Swagger for API support, and Buddy for authentication middleware. Your new web app is in the directory,
mywebapp .
Sometimes you need to configure
lein to use a custom JDK. On Linux, set the environment variable
JAVA_CMD to point to the
java executable you want
lein to use.
For example, you might add the following lines to your
.bash_profile
1
2
3
4
5
#used by LEIN
JAVA_CMD=$HOME/installs/jdk-11.0.10+8/bin/java
export JAVA_CMD
Once you update your bash profile, you can start using your configuration by using the following command.