This question already has an answer here:
Unexpected Difficulties with "Hello, World!"
(1 answer)
Closed 8 years ago.
I just installed Leiningen 2.4.3 using the install script for my Ubuntu 14.04 system. When I attempt to use lein to enter the REPL, I get a rather nasty dump to the console:
charles#charles-930X5J-910S5J-940X5J:~$ lein repl
nREPL server started on port 60889 on host 127.0.0.1 - nrepl://127.0.0.1:60889
Exception in thread "nREPL-worker-0" java.lang.NoSuchMethodError: clojure.tools.nrepl.StdOutBuffer.length()I
at clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
at clojure.lang.RestFn.invoke(RestFn.java:460)
at clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown Source)
at java.io.PrintWriter.write(PrintWriter.java:456)
at java.io.PrintWriter.write(PrintWriter.java:473)
at clojure.core$fn__5471.invoke(core_print.clj:191)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at clojure.core$pr_on.invoke(core.clj:3392)
at clojure.core$pr.invoke(core.clj:3404)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$prn.doInvoke(core.clj:3437)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$println.doInvoke(core.clj:3457)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$repl_caught.invoke(main.clj:158)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
at clojure.main$repl$fn__6634.invoke(main.clj:259)
at clojure.main$repl.doInvoke(main.clj:257)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
at clojure.core$comp$fn__4192.invoke(core.clj:2402)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
REPL-y 0.3.2, nREPL 0.2.0-beta5NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)#Exception in thread "nREPL-worker-1" java.lang.NoSuchMethodError: clojure.tools.nrepl.StdOutBuffer.length()I
at clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
at clojure.lang.RestFn.invoke(RestFn.java:460)
at clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown Source)
at java.io.PrintWriter.write(PrintWriter.java:456)
at java.io.PrintWriter.write(PrintWriter.java:473)
at clojure.core$fn__5471.invoke(core_print.clj:191)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at clojure.core$pr_on.invoke(core.clj:3392)
at clojure.core$pr.invoke(core.clj:3404)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$prn.doInvoke(core.clj:3437)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$println.doInvoke(core.clj:3457)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$repl_caught.invoke(main.clj:158)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
at clojure.main$repl$fn__6634.invoke(main.clj:259)
at clojure.main$repl.doInvoke(main.clj:257)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
at clojure.core$comp$fn__4192.invoke(core.clj:2402)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Error loading namespace; falling back to userNoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)user=>
I need some help interpreting what this means and how to fix it. Running JDK 1.8.0_20
This is a known bug with lein 2.4.3. Until a new stable version is available, it can be fixed by running the following code:
lein upgrade 2.4.2. Also, this problem only shows up in projectless repls, if you create a new project, and run lein from inside the project directory, the error will not occur.
Related
In the past I've use the windows installer provided at clojure.org to install clojure on my various Windows machines. Clojure 1.9 has been out for a few weeks now but still no sign of an installer for Windows or a generic Java-based install, as far as I can find.
I've tried downloading the jars from clojure.org and running
java -jar clojure.1.9.0.jar
but that just dumps stack:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.classForName(RT.java:2204)
at clojure.lang.RT.classForName(RT.java:2213)
at clojure.lang.RT.loadClassForName(RT.java:2232)
at clojure.lang.RT.load(RT.java:450)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.core.server$loading__6434__auto____8456.invoke(server.clj:9)
at clojure.core.server__init.load(Unknown Source)
at clojure.core.server__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.classForName(RT.java:2204)
at clojure.lang.RT.classForName(RT.java:2213)
at clojure.lang.RT.loadClassForName(RT.java:2232)
at clojure.lang.RT.load(RT.java:450)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.core$require.doInvoke(core.clj:5947)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:381)
at clojure.lang.RT.doInit(RT.java:487)
at clojure.lang.RT.<clinit>(RT.java:336)
at clojure.main.<clinit>(main.java:20)
Caused by: java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class or clojure/spec/alpha.clj on classpath.
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.main$loading__6434__auto____8543.invoke(main.clj:11)
at clojure.main__init.load(Unknown Source)
at clojure.main__init.<clinit>(Unknown Source)
... 55 more
and as I don't have files clojure/spec/alpha__init.class or clojure/spec/alpha.clj it appears that at the moment I'm out of luck.
So - is there a step-by-step to go from having the 1.9.0 jars to making it all run on Windows?
All suggestions welcomed.
TL;DR:
You also have to download org.clojure/spec.alpha and org.clojure/core.specs.alpha. Then start with:
java -cp clojure-1.9.0-alpha17.jar;spec.alpha-0.1.123.jar;core.specs.alpha-0.1.10.jar clojure.main
(Note, that your versions there will be different; and there will be : instad of ; for the unix family of OS).
How to find out about and fetch the other deps
With the recent change in Clojure to use dedicated artifacts for Spec in an alpha sub-namespace, it is no longer easy to start a simple REPL just with the regular jar (e.g. java -jar $CLOJURE_JAR clojure.main). So how to start it now?
As of before you are better off to do a lein new somewhere, change the org.clojure/clojure dependency to the version you like and do a lein deps :tree to fetch all that is needed and display what things org.clojure/core now depends on. E.g.
[org.clojure/clojure "1.9.0-alpha17"]
[org.clojure/core.specs.alpha "0.1.10" :exclusions [[org.clojure/clojure] [org.clojure/spec.alpha]]]
[org.clojure/spec.alpha "0.1.123" :exclusions [[org.clojure/clojure]]]
All your artifacts end up in ~/.m2/repository. So next you have to build up your classpath to call the REPL. You can now run lein with-profile uberjar cp in that dummy project to get the class path Leiningen is using. E.g.:
$ lein with-profile uberjar cp
/tmp/xxx/test:/tmp/xxx/src:/tmp/xxx/resources:/tmp/xxx/target/classes:/home/user/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/user/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/user/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
# this will be `;` instead of `:` as well here for windows
Remove the test, src, and resources ones and that is, what you have to pass to -cp.
Future solution
As stated in the Getting Started the clojure CLI is not yet available for Windows.
When I first open a fresh install of Counterclockwise standalone and attempt to create a Clojure project I get an error dialog with the following message:
The selected wizard could not be started.
Reason:
Plug-in ccw.core was unable to load class ccw.leiningen.NewLeiningenProjectWizard
Details:
An error occurred while automatically activating bundle ccw.core (4)
No further information on this error seems to be available. I've put the Counterclockwise installation directory (C:\counterclockwise-0.35.1.STABLE001) in the class path but this did not affect anything.
If I try to open a Namespace Browser I get something similar:
org.eclipse.core.runtime.CoreException: Plug-in ccw.core was unable to load class ccw.repl.NamespaceBrowser.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
...etc...
I suspect that this is some type of classpath issue but as I'm new to Java I don't know how to resolve this.
I've hunted the web and haven't found anything which looks like this issue.
This occurs on multiple machines with:
Windows 10 64-bit
Counterclockwise IDE Version 0.35.1.STABLE001 for Windows 64
Clojure 1.8
java
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
Any suggestions appreciated.
EDIT
Would I be better off installing Eclipse Neon first and then installing Counterclockwise as a plug-in?
EDIT
TL;DR
If you dig through the error log excerpt below, near the bottom you'll find
Caused by: java.lang.IllegalArgumentException: No implementation of method: :matcher-fn of protocol: #'net.cgrand.parsley.lrplus/MatcherFactory found for class: paredit.parser$reify__1553
So is this some kind of issue with the Clojure version being run? I do notice that in the Counterclockwise dependencies below I see
[org.clojure/clojure-contrib "1.2.0"]
which seem like its from a very outdated version of Clojure. I've got this on my machine because it's part of a plugin for another editor (jEdit). Might this be the source of the issue? I've got jEdit and its Clojure plugin which includes this outdated version of Clojure on the other machines I've tried this on too, but the directory containing the old version of Clojure is not in the class path or the path. ????
FWIW when I export the Eclipse error log view I get about 12K+ lines of output. The first several hundred are
!SESSION 2016-12-30 20:49:15.136 -----------------------------------------------
eclipse.buildId=0.35.1.STABLE001
java.version=1.8.0_111
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64
!ENTRY ccw.core 1 0 2016-12-30 20:49:31.022
!MESSAGE CCWPlugin.start(): ENTER
!ENTRY ccw.core 1 0 2016-12-30 20:49:36.144
!MESSAGE Counterclockwise dependencies:
[bultitude "0.2.1"]
[ccw/ccw.server "0.2.1"]
[ccw/clojure-ccw "1.7.0"]
[cheshire "5.0.2"]
[classlojure "0.6.6"]
[clj-http "0.9.2"]
[clj-stacktrace "0.2.7"]
[clj-tuple "0.1.2"]
[clojure-complete "0.2.3"]
[com.cemerick/drawbridge "0.0.6"]
[com.cemerick/pomegranate "0.3.0"]
[com.fasterxml.jackson.core/jackson-core "2.1.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.1.2"]
[com.hypirion/io "0.3.1"]
[commons-codec "1.9"]
[commons-fileupload "1.2.1"]
[commons-io "2.4"]
[commons-lang "2.6"]
[commons-logging "1.1.3"]
[dynapath "0.2.0"]
[jline "2.12"]
[leiningen "2.5.1"]
[leiningen-core "2.5.1"]
[net.cgrand/parsley "0.9.2"]
[net.cgrand/regex "1.1.0"]
[net.cgrand/sjacket "0.1.1"]
[net.mikera/cljunit "0.2.0"]
[org.apache.httpcomponents/httpclient "4.3.3"]
[org.apache.httpcomponents/httpcore "4.3.2"]
[org.apache.httpcomponents/httpmime "4.3.3"]
[org.apache.maven/maven-aether-provider "3.0.4"]
[org.apache.maven/maven-model "3.0.4"]
[org.apache.maven/maven-model-builder "3.0.4"]
[org.apache.maven/maven-repository-metadata "3.0.4"]
[org.apache.maven.indexer/indexer-artifact "4.1.3"]
[org.apache.maven.indexer/indexer-core "4.1.3"]
[org.apache.maven.wagon/wagon-http "2.7"]
[org.apache.maven.wagon/wagon-http-shared "2.7"]
[org.apache.maven.wagon/wagon-provider-api "2.2"]
[org.clojure/clojure-contrib "1.2.0"]
[org.clojure/core.incubator "0.1.0"]
[org.clojure/data.xml "0.0.3"]
[org.clojure/java.classpath "0.2.2"]
[org.clojure/java.data "0.1.1"]
[org.clojure/tools.cli "0.3.1"]
[org.clojure/tools.logging "0.2.3"]
[org.clojure/tools.macro "0.1.1"]
[org.clojure/tools.nrepl "0.2.10"]
[org.clojure/tools.reader "0.8.4"]
[org.codehaus.plexus/plexus-classworlds "2.4"]
[org.codehaus.plexus/plexus-component-annotations "1.5.5"]
[org.codehaus.plexus/plexus-interpolation "1.14"]
[org.codehaus.plexus/plexus-utils "2.0.6"]
[org.jsoup/jsoup "1.7.2"]
[org.sonatype.aether/aether-api "1.13.1"]
[org.sonatype.aether/aether-connector-file "1.13.1"]
[org.sonatype.aether/aether-connector-wagon "1.13.1"]
[org.sonatype.aether/aether-impl "1.13.1"]
[org.sonatype.aether/aether-spi "1.13.1"]
[org.sonatype.aether/aether-util "1.13.1"]
[org.sonatype.sisu/sisu-inject-bean "2.2.3"]
[org.sonatype.sisu/sisu-inject-plexus "2.2.3"]
[org.tcrawley/dynapath "0.2.3"]
[pedantic "0.2.0"]
[potemkin "0.3.4"]
[prismatic/schema "0.4.4"]
[quoin "0.1.2"]
[reply "0.3.5"]
[riddley "0.1.6"]
[ring/ring-core "1.0.2"]
[robert/hooke "1.3.0"]
[scout "0.1.0"]
[slingshot "0.10.3"]
[stencil "0.3.5"]
[trptcolin/versioneer "0.1.1"]
!ENTRY org.eclipse.osgi 4 0 2016-12-30 20:49:40.712
!MESSAGE An error occurred while automatically activating bundle ccw.core (4).
!STACK 0
org.osgi.framework.BundleException: Exception in ccw.CCWPlugin.start() of bundle ccw.core.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:327)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:402)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:573)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.processLanguages(ReflectionContributionFactory.java:137)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.<init>(ReflectionContributionFactory.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:502)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:522)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:203)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:628)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.classForName(RT.java:2155)
at clojure.lang.RT.classForName(RT.java:2164)
at clojure.lang.RT.loadClassForName(RT.java:2183)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at ccw.editors.clojure.editor_support$loading__5340__auto____2430.invoke(editor_support.clj:12)
at ccw.editors.clojure.editor_support__init.load(Unknown Source)
at ccw.editors.clojure.editor_support__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.classForName(RT.java:2155)
at clojure.lang.RT.classForName(RT.java:2164)
at clojure.lang.RT.loadClassForName(RT.java:2183)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at ccw.editors.clojure.hover_support$loading__5340__auto____7902.invoke(hover_support.clj:12)
at ccw.editors.clojure.hover_support__init.load(Unknown Source)
at ccw.editors.clojure.hover_support__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.classForName(RT.java:2155)
at clojure.lang.RT.classForName(RT.java:2164)
at clojure.lang.RT.loadClassForName(RT.java:2183)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:379)
at ccw.util.osgi.ClojureOSGi$1.run(ClojureOSGi.java:137)
at ccw.util.osgi.ClojureOSGi.withBundle(ClojureOSGi.java:107)
at ccw.util.osgi.ClojureOSGi.withBundle(ClojureOSGi.java:52)
at ccw.util.osgi.ClojureOSGi.require(ClojureOSGi.java:133)
at ccw.util.ClojureInvoker.newInvoker(ClojureInvoker.java:46)
at ccw.util.ClojureInvoker.newInvoker(ClojureInvoker.java:42)
at ccw.CCWPlugin.initInjections(CCWPlugin.java:727)
at ccw.CCWPlugin.start(CCWPlugin.java:276)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
... 42 more
Caused by: java.lang.IllegalArgumentException: No implementation of method: :matcher-fn of protocol: #'net.cgrand.parsley.lrplus/MatcherFactory found for class: paredit.parser$reify__1553
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:554)
at net.cgrand.parsley.lrplus$eval775$fn__776$G__766__783.invoke(lrplus.clj:32)
at net.cgrand.parsley.lrplus$matcher$fn__846.invoke(lrplus.clj:123)
OK, problem solved.
The resolution was fairly simple - it boils down to the old joke:
Patient: Doctor, it hurts when I do this!
Doctor: THEN DON'T DO THAT!!!!!!
In this case the "DON'T DO THAT!" is "don't use the pre-built standalone version of CounterClockwise", at least on Windows. Install Eclipse Neon (I used the 64-bit version of the "Eclipse IDE For Java Developers" package from http://www.eclipse.org/downloads/eclipse-packages/), go to the marketplace (Help/Eclipse Marketplace...), type "counterclockwise" into the Find box, hit enter, install the CounterClockwise plug-in, restart Eclipse, and it runs. I still can't get it the debugger to work - it won't break on breakpoints - but at least I've gotten it to work somewhat.
I installed leiningen on my Ubuntu, but it throws a "Connection refused" error when I run lein repl. Here's the error:
$ lein repl
Exception in thread "Thread-4" java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at clojure.tools.nrepl$connect.doInvoke(nrepl.clj:184)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.tools.nrepl.ack$send_ack.invoke(ack.clj:47)
at clojure.tools.nrepl.server$start_server.doInvoke(server.clj:146)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at user$eval540.invoke(NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.eval(Compiler.java:6582)
at clojure.core$eval.invoke(core.clj:2852)
at leiningen.core.eval$fn__3577.invoke(eval.clj:304)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:326)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.repl$server$fn__7443.invoke(repl.clj:201)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)
I had saw a question like this at github:lein repl error, but it doesn't solve my problem. Anyone knows why?
environment
os: ubuntu 12.04
leningen: Leiningen 2.3.4
java: 1.7.0_21
First of all your stack trace is missing the Caused by... original exception.I didn't experienced it but I has been able to reproduce it getting the same stacktrace j plus these lines
Caused by: java.net.UnknownHostException: i7mito: System error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
at java.net.InetAddress.getLocalHost(InetAddress.java:1462)
... 36 more
if I removed my machine name (i7mito) from the /etc/hosts/ file and I left it like
127.0.0.1 localhost
So my guess is that lein relies on the DNS to resolve your machine name ( i7mito in my case) to an IP address. The first step in this name resolution is your hosts file so I would check that first. I realized that the IP you bind to localhost doesn't matter, it's the IP that it's binded to the result of the hostname command what matters.
So if you ensure that your machine name it's mapped to 127.0.0.1 on the /etc/hosts file it may work. If it doesn't check your network configuration as other users are pointed out as it seems something related.
Hope it helps, of course this applies if you get the same extra lines on the stacktrace :)
I'm running Debian Wheezy, openjdk-7-jre, clojure 1.4.0 and leiningen-1.7.1, all installed from official repo.
So I ran
lein new hello
cd hello
lein run -m hello.core
and saw an error:
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: hello.core
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.RT.classForName(RT.java:2017)
at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:206)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:92)
at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:225)
at user$eval35.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: hello.core
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at clojure.lang.RT.classForName(RT.java:2013)
... 21 more
I never written anything before in Java so this is very cryptic for me.
I tried to add
:main hello.core
to my project.clj file and then just
lein run
but it didn't helped me.
To run the main function, make sure that hello.core contains -main method like this:
(ns hello.core)
(defn -main
[& args]
(println "Hello, World!"))
and you can run it with the -m flag: lein run -m hello.core.
Or you can run arbitrary function if you specify its name:
(ns hello.core)
(defn my-run
[& args]
(println "Hello, World! from Run"))
And call it with the namespace/function_name as an argument:
lein run -m hello.core/my-run
You might want to start with:
lein new app hello
That should create a skeleton project setup for a stub main method.
It will also drop in a gen-class in the right place so you can use uberjar for
deployment.
I'm just starting learning Clojure and web programming. I've installed Leiningen 2.0.0-preview2 on Clojure 1.3.0 and it can create projects correctly. But I always got That's not a task. Use "lein help" to list all tasks. error when I ran lein plugin install lein-noir 1.2.1 to install noir.
I've also tried to added lein-noir as a :dev-dependencies into project.clj and ran lein deps but it did nothing.
Does anyone know what's the problem and how can I resolve it. Thanks a lot!
My environment:
Mac OS X 10.6.8
Java 6
Leiningen 2.0.0-preview2
I've also tryed Leiningen 1.7 but got different error and someone said it's because leiningen 1.7 can only work with Clojure 1.2.x
Here's the error when I use Leiningen 1.7:
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$script_opt.invoke(main.clj:339)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:426)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
at leiningen.util.plugins$stale_QMARK_.(plugins.clj:68)
at leiningen.util.plugins__init.load(Unknown Source)
at leiningen.util.plugins__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at leiningen.core$loading__4414__auto__.invoke(core.clj:1)
at leiningen.core__init.load(Unknown Source)
at leiningen.core__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval1.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
... 11 more
If you have added lein-noir to .lein/profiles.clj like above you need to run the command :
lein new noir yoursitename.
Not lein noir new my-website !
Also add lein-noir "1.2.1"
Leiningen 2 is very new. Most of the documentation out there is still describing how to do things with leiningen 1.7.0. The ways you've tried to install lein-noir don't work with leiningen 2. The documentation describing how lein version 2 is different from lein 1.7.0 can be found here.
In a nutshell, you need to create a profiles.clj file in your ~/.lein directory. To specify you want to use lein-noir, your ~/.lein/profiles.clj file should look like:
{:user {:plugins [[lein-noir "1.2.1"]]}}
Now you can create a new noir project by typing:
lein new noir projectname