I want to learn Clojure and I want to use IntelliJ and the Cursive plugin.
Can I easily install all of these ?
Roelof
I want to learn Clojure and I want to use IntelliJ and the Cursive plugin.
Can I easily install all of these ?
Roelof
Yes, you can (or in the case of Cursive soon be able to) instal these.
Clojure is available in the Universe repository, which should be enable by default. The most recent version available is 1.4, available in 13.10 and 14.04.
sudo apt-get install clojure1.4
12.04 has version 1.2.
sudo apt-get install clojure1.2
The most recent version of Clojure is 1.6. If you really need the newest version, you can download a binary in a jar file, which you can easily run from your home directory. It is also available in the official repositories from 15.04 onwards.
IntelliJ Idea is a commercial product, but Community edition is free. Even through it is free, it needs to purchased through the Software Center.
One note of warning, when starting IntelliJ you are likely to see a warning message saying that it should work with OpenJDK, but that it expects Oracle Java and that using OpenJDK is unsupported.
According to the Cursive website , is not yet available. It will be also be a commercial product, but they say it will work with the IntelliJ Community edition.
It is not useful or necessary to load Clojure jar files as these will be loaded on demand by leiningen.
To get leiningen it's easier to get the lein script from the leiningen site. This will also help you get an up-to-date version of Leiningen.
You only need to install the java JDK and Leiningen
sudo apt-get install openjdk-7-jdk leiningen
My setup is as following:
:~ > java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
:~ > lein -v
Leiningen 1.7.1 on Java 1.7.0_65 OpenJDK 64-Bit Server VM
If you want to use Clojure 1.6, use a project.clj file like this
(defproject MyAwesomeProject "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.6.0"]])
Cursive is not yet available so you have to use something else. My choice of IDE is Counterclockwise. It uses Leiningen to manage the dependancies so you have virtually nothing to do. When Intellij IDEA will have the Cursive plugin, you will be able to switch easily.
If you wish to update the dependancies manually, cd to your project directory and do
:~/Clojure/MyAwesomeProject > lein deps
Copying 18 files to /home/francois/Clojure/MyAwesomeProject/lib
Clojure CLI provides a simple way to run Clojure code and start a Clojure REPL (a lighter alternative to Leiningen)
Download the Clojure install script for Linux and run the install:
curl -O https://download.clojure.org/install/linux-install-1.11.1.1208.sh
chmod +x linux-install-1.11.1.1208.sh
sudo ./linux-install-1.11.1.1208.sh
Change the version number of the script when a new release is available. See https://clojure.org/guides/install_clojure for the latest release and details of other install options.
Complement Clojure CLI tools with a wide range of community tools, typically added via a user configuration such as practicalli/clojure-deps-edn
The debian package of Clojure CLI in the Ubuntu software repository is many versions behind (at time of writing), so installing Clojure CLI via a package is not recommended.
NOTE: Clojure is a hosted language on the Java Virtual Machine (JVM) which is provided via the openjdk package, e.g. openjdk-17-jre
(java run-time) or openjdk-17-jdk
(java development kit)
sudo apt install openjdk-17-jre