All Projects → liebke → Cljr

liebke / Cljr

cljr is a Clojure REPL and package management system.

Programming Languages

clojure
4091 projects

Cljr is a Clojure REPL and package manager. It's designed to complement the project-oriented approach of dependency management systems like Leiningen and Maven, both of which are my preferred tools for managing traditional-project dependencies. However, much of what I use Clojure for, including Incanter-based data analysis, is not really project-oriented. In these cases, it is more convenient to have access to a REPL (and Swank server) backed by a global package-management system.

Another goal of the cljr project is to improve the out-of-box experience for Clojure. There are many approaches to helping people get started with Clojure, from the streamlined starter-pack called Dejour, which only includes Clojure and Clojure-contrib, to the full-monty approach of labrepl, which includes several additional Clojure libraries, instructions for configuring every available Clojure IDE plugin, and web-based Clojure tutorials.

Cljr takes a third approach by providing an easy to launch REPL combined with the ability to easily search for and install Clojure packages from the Clojars repository.

Cljr uses Leiningen to manage the packages in the .cljr repository, and there is a project.clj file in the .cljr directory that can be customized by hand if desired.

h2. Quick start

Install

Download cljr-installer.jar

Run @java -jar [email protected]

** Note 1: If your browser added a .zip extension to the jar during download, just run: @java -jar [email protected] ** Note 2: Requires java 1.6

Add @~/.cljr/bin/@ to your path (or copy the platform appropriate @cljr@ script to your path).

Try it out

Run @cljr [email protected] to see what packages are installed.

Run @cljr search [email protected] to search for Compojure on Clojars.

Run @cljr describe [email protected] to get a description of the latest version of compojure.

Run @cljr install [email protected] to install the latest version of compojure.

Run @cljr [email protected] or @cljr [email protected] to launch a REPL configured for all the installed packages.

You can also use the executable jar, cljr.jar, installed in ~/.cljr to run commands:

h2. Documentation

Usage: @cljr command [arguments]@

Available commands

Options

  • CLOJURE_HOME: If this environment variable is set, jar files in this directory will be included first on the classpath. ** To use a custom build of Clojure/Clojure-contrib, set the CLOJURE_HOME environment variable, place clojure*.jar and clojure-contrib*.jar files in the specified directory, and remove the current clojure/clojure-contrib jar files from the ~/.cljr/lib directory. Note: Installing new packages will likely reinstall Clojure/Clojure-contrib in the cljr lib directory.
  • DISABLE_JLINE: To disable JLine when using the command line repl, set this environment variable to true. @export DISABLE_JLINE="true"@ ** Note: JLine is only used in the command line repl on Unix/Linux/Mac OS X, not on Windows.
  • JVM_OPTS: The default value is "-Xmx1G". ** For example, to set the server flag, run the following sh command: @export JVM_OPTS="-Xmx2G -server"@ ** Another example, to set an HTTP proxy add the following options @export JVM_OPTS="-Dhttp.proxyHost=my-proxy-host -Dhttp.proxyPort=my-proxy-port"@

To view the JVM options from a repl, use the following call: @(.getInputArguments (java.lang.management.ManagementFactory/getRuntimeMXBean))@

Packages are installed in @$HOME/.cljr/[email protected], and can be used by applications other than @cljr@ by including the jars in the directory on the classpath. For instance, to start a command line REPL with jline, run the following command:

@java -cp ~/.cljr/lib/'*' jline.ConsoleRunner [email protected]

Installation Download the cljr-installer.jar file (or follow the instructions below to build from source):

@wget http://incanter.org/downloads/[email protected]

and either double-click on the jar file to run it from the command line:

@java -jar [email protected]

The installer will

Alternative installation directories You can provide alternative CLJR_HOME and USER_HOME directories by passing them as properties to the above java command.

For instance, the following command creates the @[email protected] and Maven @[email protected] directories under @C:@ on a Windows box (something I had to do since Windows had problems with my shared home under VMWare, \vmware-host...).

@java -Duser.home=C: -jar [email protected]

cljr scripts Once installation is complete, you should either add @$HOME/.cljr/[email protected] to your path, @export PATH=~/.cljr/bin:[email protected] on Unix/Mac OS X, or move the platform-appropriate cljr script to a directory on your path.

h2. Build instructions

Run @script/[email protected]

Copyright (C) 2010 David Edgar Liebke

Distributed under the Eclipse Public License, the same as Clojure.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].