日期:2014-05-20 浏览次数:20979 次
#!/bin/bash
CLOJURE_VERSION=1.3.0
CONTRIB_VERSION=1.2.0
CLOJURE_HOME=/opt/clojure
CLOJURE_DIR=$CLOJURE_HOME/library
CLOJURE_JAR=$CLOJURE_DIR/clojure-$CLOJURE_VERSION.jar
CLOJURE_CONTRIB=$CLOJURE_DIR/clojure-contrib-$CONTRIB_VERSION.jar
CLOJURE_LIBRARY=$CLOJURE_JAR:$CLOJURE_CONTRIB
MAVEN_REPOSITORY=/home/xxx/.m2/repository
JLINE_JAR=$MAVEN_REPOSITORY/jline/jline/1.0/jline-1.0.jar
CLOJURE_USER_PROFILE=$CLOJURE_HOME/init.clj
# IBM JRE
IBM_HOME=/opt/java/share/ibm-java-sdk-6.0-8.1-linux-i386/jre
IBM_JVMOptions="-Xquickstart -Xshareclasses:expire=10000,name=clojure -Xgcpolicy:gencon"
# JRockite JRE
JROCKIT_HOME=/opt/java/jrockit/jre
JROCKIT_JVMOptions="-XXaggressive -XX:+UseNewHashFunction -XX:+UseCallProfiling -XXnoSystemGC"
# SUN JRE
SUN_HOME=/opt/java/javasdk/jre
SUN_JVMOptions="-XX:+AggressiveOpts \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseFastAccessorMethods \
-XX:+UseG1GC \
-XX:+ExplicitGCInvokesConcurrent \
-XX:-DisableExplicitGC \
-XX:+TieredCompilation"
JRE_HOME=$SUN_HOME
JVMOptions=$SUN_JVMOptions
JAVACMD=$JRE_HOME/bin/java
JVMOptions="$JVMOptions" # -Djline.terminal=jline.UnixTerminal"
breakchars="(){}[],^%$#@\"\";:''
------解决方案--------------------
\\"
completions=/home/xxx/workspace/jvm/examples/clojure_completions
history=/home/xxx/.clojure_history
if [ -z "$1" ]; then
exec rlwrap --remember -c -b "$breakchars" -f "$completions" -H "$history" \
"${JAVACMD:-java}" $JVMOptions -classpath $CLOJURE_LIBRARY clojure.main --init $CLOJURE_USER_PROFILE -r
else
exec "${JAVACMD:-java}" $JVMOptions -cp $CLOJURE_LIBRARY clojure.main --init $CLOJURE_USER_PROFILE "$@"
fi
exit