Как мне заставить 'Cake Repl' работать на OSX? (Я получаю 'Исключение в потоке "main" java.lang.NoClassDefFoundError: clojure/main')
Я пытаюсь заставить clojure/emacs/swank/cake работать вместе. Согласно ассембле, мне нужен 'торт-репл', чтобы запустить репл, но я продолжаю получать ошибку NoClassDefFoundError. Есть идеи, как это исправить?
Вот что я получаю в командной строке:
$ cake ps
7876 main -Dcake.project=/Users/bmaddy/.cake -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
$ echo $CLASSPATH
$ java -version
java version "1.5.0_26"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_26-b03-376-9M3263)
Java HotSpot(TM) Client VM (build 1.5.0_26-156, mixed mode, sharing)
$ ruby -v
ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
$ cake repl
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
[cake] connection to bake jvm is taking a long time...
[cake] you can use ^C to abort and use 'cake kill' or 'cake kill -9' to force the jvm to restart
^C/Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:509:in `sleep': Interrupt
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:509:in `with_socket'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:431:in `repl'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:430:in `loop'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:430:in `repl'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:822:in `send'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:822
from /Users/bmaddy/.gem/ruby/1.8/bin/cake:19:in `load'
from /Users/bmaddy/.gem/ruby/1.8/bin/cake:19
$ cake ps
7876 main -Dcake.project=/Users/bmaddy/.cake -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
12539 main -Dcake.project=/Users/bmaddy/Documents/books/SICP -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
Больше информации:
$ cake deps force
[deps] Fetching dependencies...
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojure
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojure-snapshots
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojars
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from maven
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojure at http://build.clojure.org/releases
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojure (http://build.clojure.org/releases)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojure-snapshots at http://build.clojure.org/snapshots
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojure-snapshots (http://build.clojure.org/snapshots)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojars at http://clojars.org/repo
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojars (http://clojars.org/repo)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository maven at http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository maven (http://repo1.maven.org/maven2)
[deps] Copying 3 files to /Users/bmaddy/Documents/books/SICP/build/lib
[deps] Deleting directory /Users/bmaddy/Documents/books/SICP/lib
[deps] Attempting to rename dir: /Users/bmaddy/Documents/books/SICP/build/lib to /Users/bmaddy/Documents/books/SICP/lib
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/clean
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/default
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/deps
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/help
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/pom
[deps] Restarting project jvm
2 ответа
Решение
Оказывается, это была проблема с Clojure и Java 1.5. Исправление на OS X было использовать /Applications/Utilities/Java Preferences.app
перейти на Java 1.6.
Похоже, ваш проект по умолчанию торт не имеет clojure jar. Попробуйте запустить cake deps force
,