You are here:   ArielOrtiz.com > Programming Languages > Installing Clojure on Ubuntu

Installing Clojure on Ubuntu

These instructions allow you to install Clojure 1.6 on Ubuntu 14.04.

  1. Create and move to the directory where you want to install Java and Clojure. For example, in your $HOME directory, type the following at the terminal in order to create a Programs directory:
    mkdir Programs
    
    cd Programs
    
  2. Download the JDK 1.8 into the Programs directory:

    Extract the tarball file. At the terminal type:

    tar xzf jdk-8u11-linux-x64.tar.gz
    
  3. Download the following JAR files into the Programs/jdk1.8.0_11/jre/lib/ext directory:

  4. Edit the .bashrc file. At the terminal type:

    gedit $HOME/.bashrc

    Go to very end of the file and add the following lines:

    export JAVA_HOME=$HOME/Programs/jdk1.8.0_11
    export PATH=$JAVA_HOME/bin:$PATH
    alias clj='java jline.ConsoleRunner clojure.main' 
    

    Save the file.

  5. Close all open terminal windows and open a new one. Verify that Clojure was installed correctly. Type at the command line:
    clj
    You should see the Clojure REPL (Read Eval Print Loop):
    Clojure 1.6.0
    user=>
    Type Ctrl-D to exit the REPL.
  6. If you use jEdit as your Clojure editor, you can use Daniel Spiewak’s Clojure mode file. Just copy the clojure.xml file into jEdit’s modes directory.

    Check the Clojure IDEs and Editors page to see other options.