Unable to run Clojure (jline is missing)

125 views
Skip to first unread message

HB

unread,
Dec 8, 2010, 8:47:56 PM12/8/10
to Clojure
Hi,
I downloaded Clojure 1.2 https://github.com/downloads/clojure/clojure/clojure-1.2.0.zip
and extract it.
I created CLOJURE_HOME and added $CLOJURE_HOME/script to my $PATH
Upon trying clj or repl , I got this error:

Exception in thread "main" java.lang.NoClassDefFoundError: jline/
ConsoleRunner
Caused by: java.lang.ClassNotFoundException: jline.ConsoleRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

Any idea what is going wrong?
I'm on OS X 10.6

Thanks for help and time.


Tim Robinson

unread,
Dec 8, 2010, 8:54:55 PM12/8/10
to Clojure
Did you download jline and put it in a location where it can been
accessed with the classpath?

http://jline.sourceforge.net/


On Dec 8, 6:47 pm, HB <hubaghd...@gmail.com> wrote:
> Hi,
> I downloaded Clojure 1.2https://github.com/downloads/clojure/clojure/clojure-1.2.0.zip

HB

unread,
Dec 8, 2010, 9:00:01 PM12/8/10
to Clojure
I expect Clojure maintainers to provide a working distro but anyway,

I checked clj script under the script directory:

#!/bin/sh

CLASSPATH=src/clj:test:test-classes:classes/:script/
jline-0.9.94.jar:../clojure-contrib/target/clojure-contrib-1.2.0-
SNAPSHOT.jar

if [ -z "$1" ]; then
exec java -server jline.ConsoleRunner clojure.main
else
SCRIPT=$(dirname $1)
export CLASSPATH=$SCRIPT/*:$SCRIPT:$CLASSPATH
exec java -Xmx3G -server clojure.main "$1" "$@"
fi


I copied the jline jar to script directory but I still get the same
error.

Alex Osborne

unread,
Dec 8, 2010, 11:39:29 PM12/8/10
to clo...@googlegroups.com
HB <hubag...@gmail.com> writes:

> I checked clj script under the script directory:
>
> #!/bin/sh
>
> CLASSPATH=src/clj:test:test-classes:classes/:script/
> jline-0.9.94.jar:../clojure-contrib/target/clojure-contrib-1.2.0-
> SNAPSHOT.jar
>
> if [ -z "$1" ]; then
> exec java -server jline.ConsoleRunner clojure.main
> else
> SCRIPT=$(dirname $1)
> export CLASSPATH=$SCRIPT/*:$SCRIPT:$CLASSPATH
> exec java -Xmx3G -server clojure.main "$1" "$@"
> fi

That script looks simply broken. In the case where no arguments are
supplied the classpath is not set at all (it'd need an "export
CLASSPATH").

For those not used to the JVM, the CLASSPATH is where Java (and Clojure)
search for classes and clj files. On unix it's a colon-separated list
of directories and jar files.

I suggest you completely ignore that script subdirectory, it looks to me
like it contains personal debugging and benchmark scripts that have been
included in the distribution by accident.

To run a Clojure REPL, just type this:

java -jar clojure.jar

You can see more options:

java -jar clojure.jar -h

Most Clojure developers that I know normally use a build tool and/or IDE
rather than working directly from the distribution though.

Personally I use Leiningen:

http://github.com/technomancy/leiningen
http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md

If you come from a Java background you might be more used to a
particular IDE or Maven. There's a nice list here:

http://www.assembla.com/wiki/show/clojure/Getting_Started

HB

unread,
Dec 9, 2010, 12:13:54 AM12/9/10
to Clojure
I think it is unacceptable to provide broken, unpolished and not
working scripts.
I'm definitely respect the maintainers, I'm just annoyed because I
spent a couple of hours trying to make it works.
Thanks Alex, I owe you a huge mug of beer :)

On Dec 9, 6:39 am, Alex Osborne <a...@meshy.org> wrote:
> http://github.com/technomancy/leiningenhttp://github.com/technomancy/leiningen/blob/master/TUTORIAL.md
Reply all
Reply to author
Forward
0 new messages