From 6b3576f89507428f5bf86eb876918fbe2b29c131 Mon Sep 17 00:00:00 2001 From: David Edgar Liebke Date: Mon, 21 Dec 2009 20:43:53 -0500 Subject: [PATCH] renamed incanter-*-jar-with-dependencies.jar to incanter-exec.jar, and added instructions on running Incanter directly with 'java -jar incanter-exec.jar' --- README.textile | 6 ++++++ bin/clj | 2 +- bin/clj.bat | 2 +- bin/incanter | 21 --------------------- bin/incanter.bat | 12 ------------ pom.xml | 5 ++++- 6 files changed, 12 insertions(+), 36 deletions(-) delete mode 100755 bin/incanter delete mode 100755 bin/incanter.bat diff --git a/README.textile b/README.textile index 93787cd8..19d47461 100644 --- a/README.textile +++ b/README.textile @@ -44,6 +44,12 @@ A pre-built version of Incanter that includes all the necessary dependencies can Start the Clojure shell (aka the REPL) from the Incanter directory: @bin/clj@ or @bin\clj.bat@ on Windows (note: if you want to start the Clojure REPL from a directory other than the top level Incanter directory, change the INCANTER_HOME variable in the clj script so that it uses an absolute path instead the ./ directory). +You can also start Incanter directly with the following command: +@java -jar target/incanter-exec.jar@ +This will start a Clojure REPL, but will not have command history like the clj scripts. If you want to use the built-in data sets, you'll also need to set the incanter.home property as follows: +@java -Dincanter.home=/path/to/incanter/dir -jar target/incanter-exec.jar@ + + From the Clojure shell, load the Incanter libraries:
(use '(incanter core stats charts))
Try an example: sample 1,000 values from a standard-normal distribution and view a histogram:
(view (histogram (sample-normal 1000)))
diff --git a/bin/clj b/bin/clj index fefafc16..c30af186 100755 --- a/bin/clj +++ b/bin/clj @@ -8,7 +8,7 @@ INCANTER_HOME=. CLASSES_DIR=$INCANTER_HOME/target/ -INCANTER_JAR=$INCANTER_HOME/target/incanter-1.0-master-SNAPSHOT-jar-with-dependencies.jar +INCANTER_JAR=$INCANTER_HOME/target/incanter-exec.jar if [ -z "$1" ]; then #java -server -Dclojure.compile.path=$CLASSES_DIR -Dincanter.home=$INCANTER_HOME -jar $INCANTER_JAR clojure.main diff --git a/bin/clj.bat b/bin/clj.bat index 15fcbb23..f531eec8 100755 --- a/bin/clj.bat +++ b/bin/clj.bat @@ -1,7 +1,7 @@ @echo off set INCANTER_HOME=. set CLASSES_DIR=%INCANTER_HOME%\classes - set INCANTER_JAR=%INCANTER_HOME%\target\incanter-1.0-SNAPSHOT-jar-with-dependencies.jar + set INCANTER_JAR=%INCANTER_HOME%\target\incanter-exec.jar IF (%1)==() ( java -cp %INCANTER_JAR% -Dclojure.compile.path=%CLASSES_DIR% -Dincanter.home=%INCANTER_HOME% clojure.main diff --git a/bin/incanter b/bin/incanter deleted file mode 100755 index fefafc16..00000000 --- a/bin/incanter +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -##; incanter -- script to start Clojure REPL configured with the Incanter libraries - -## This script uses the uberjar file created by maven with the following commands -# $ mvn compile; mvn clojure:compile; mvn package - - -INCANTER_HOME=. -CLASSES_DIR=$INCANTER_HOME/target/ -INCANTER_JAR=$INCANTER_HOME/target/incanter-1.0-master-SNAPSHOT-jar-with-dependencies.jar - -if [ -z "$1" ]; then - #java -server -Dclojure.compile.path=$CLASSES_DIR -Dincanter.home=$INCANTER_HOME -jar $INCANTER_JAR clojure.main - java -server -Dclojure.compile.path=$CLASSES_DIR -Dincanter.home=$INCANTER_HOME -cp .:$INCANTER_JAR jline.ConsoleRunner clojure.main -else - scriptname=$1 - #java -server -Dclojure.compile.path=$CLASSES_DIR -Dincanter.home=$INCANTER_HOME -cp .:$INCANTER_JAR clojure.lang.Script $scriptname -- $* - java -server -Dclojure.compile.path=$CLASSES_DIR -Dincanter.home=$INCANTER_HOME -cp .:$INCANTER_JAR clojure.main $scriptname -- $* -fi - diff --git a/bin/incanter.bat b/bin/incanter.bat deleted file mode 100755 index 15fcbb23..00000000 --- a/bin/incanter.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off - set INCANTER_HOME=. - set CLASSES_DIR=%INCANTER_HOME%\classes - set INCANTER_JAR=%INCANTER_HOME%\target\incanter-1.0-SNAPSHOT-jar-with-dependencies.jar - - IF (%1)==() ( - java -cp %INCANTER_JAR% -Dclojure.compile.path=%CLASSES_DIR% -Dincanter.home=%INCANTER_HOME% clojure.main - ) ELSE ( - java -cp %INCANTER_JAR% -Dclojure.compile.path=%CLASSES_DIR% -Dincanter.home=%INCANTER_HOME% clojure.main %1 -- %* - ) - - diff --git a/pom.xml b/pom.xml index 46c75601..68ab02c0 100644 --- a/pom.xml +++ b/pom.xml @@ -48,9 +48,12 @@ jar-with-dependencies + incanter-exec + false - jline.ConsoleRunner + + clojure.main