我正在努力让clojure / emacs / swank / cake一起工作。根据{{3}}我需要'cake repl'来启动一个repl,但我一直得到一个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
答案 0 :(得分:0)
看起来你的默认蛋糕项目没有clojure jar。尝试运行cake deps force
。
答案 1 :(得分:0)
原来这是Clojure和Java 1.5的问题。 OS X上的修复是使用/Applications/Utilities/Java Preferences.app
切换到Java 1.6。