Clojure 1.9 windows install - clojure

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.

Related

Luminus and Re-Frame Uberjar Error

I've got a small app generated by lein new luminus <app-name> +jetty +mongodb +re-frame +cider that errors when running the uberjar command. It works as a dev app run via lein repl.
I've seen similar errors being put down to a dependency mismatch as a result of using Datomic, but that's currently not a dependency in my project.
Here's the stacktrace generated by a call to lein uberjar:
See https://github.com/technomancy/leiningen/wiki/Repeatability)
Retrieving org/clojure/core.async/0.2.374/core.async-0.2.374.jar from central
Retrieving org/clojure/tools.analyzer.jvm/0.6.9/tools.analyzer.jvm-0.6.9.jar from central
Retrieving org/clojure/tools.analyzer/0.6.7/tools.analyzer-0.6.7.jar from central
Compiling myapp.env
Compiling myapp.elastic.common
Compiling myapp.elastic.indexer
Compiling myapp.web.config
Compiling myapp.web.core
Compiling myapp.web.db.core
Compiling myapp.web.handler
Compiling myapp.web.layout
Compiling myapp.web.middleware
Compiling myapp.web.routes.home
Compiling myapp.validation
Compiling ClojureScript...
Retrieving cljsbuild/cljsbuild/1.1.4/cljsbuild-1.1.4.pom from clojars
Retrieving org/clojure/clojurescript/0.0-3211/clojurescript-0.0-3211.pom from central
Retrieving org/clojure/clojure/1.7.0-beta1/clojure-1.7.0-beta1.pom from central
Retrieving cljsbuild/cljsbuild/1.1.4/cljsbuild-1.1.4.jar from clojars
Compiling "target/cljsbuild/public/js/app.js" from ["src/cljc" "src/cljs" "env/prod/cljs"]...
Compiling "target/cljsbuild/public/js/app.js" failed.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;, compiling:(/private/var/folders/ms/7lyl677n0zz5dnw0wxffj8j00000gn/T/form-init4762266950288731870.clj:1:125)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;
at com.google.javascript.jscomp.parsing.JsDocInfoParser.validTemplateTypeName(JsDocInfoParser.java:1233)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseAnnotation(JsDocInfoParser.java:953)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseHelperLoop(JsDocInfoParser.java:290)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parse(JsDocInfoParser.java:280)
at com.google.javascript.jscomp.parsing.IRFactory.createJsDocInfoParser(IRFactory.java:910)
at com.google.javascript.jscomp.parsing.IRFactory.handleJsDoc(IRFactory.java:692)
at com.google.javascript.jscomp.parsing.IRFactory.handleJsDoc(IRFactory.java:706)
at com.google.javascript.jscomp.parsing.IRFactory.transform(IRFactory.java:766)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processAstRoot(IRFactory.java:1024)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:2712)
at com.google.javascript.jscomp.parsing.IRFactory.transformTree(IRFactory.java:356)
at com.google.javascript.jscomp.parsing.ParserRunner.parse(ParserRunner.java:129)
at com.google.javascript.jscomp.JsAst.parse(JsAst.java:142)
at com.google.javascript.jscomp.JsAst.getAstRoot(JsAst.java:52)
at com.google.javascript.jscomp.CompilerInput.getAstRoot(CompilerInput.java:118)
at com.google.javascript.jscomp.Compiler.parseInputs(Compiler.java:1443)
at com.google.javascript.jscomp.Compiler.parse(Compiler.java:775)
at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:731)
at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:83)
at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:698)
at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:695)
at com.google.javascript.jscomp.CompilerExecutor$2.call(CompilerExecutor.java:93)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Uberjar aborting because jar failed: Subprocess failed
I solved a similar problem by adding [com.google.guava/guava "21.0"] to the :dependencies in project.clj
Okay, so the clue was in the dependency mismatch. Although lein deps :tree didn't show anything awry, the issue was with monger depending on com.google.guava/guava.
By adding :exclusions [com.google.guava/guava] to each library that depends on guava (including monger) in the project.clj and moving org.clojure/clojurescript to the top of the dependency list, I was able to get the build working, as the correct version of guava for the version of Clojurescript was used, I suppose.

Unable to create Clojure project or namespace in fresh CCW standalone install

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.

Getting an exception when trying to run lein

I get the following exception when trying to run lein in linux.
Exception in thread "main" java.lang.NoClassDefFoundError: clojure.core.protocols$fn__5393
at java.lang.Class.initializeClass(libgcj.so.10)
at clojure.core.protocols__init.load(Unknown Source:16)
at clojure.core.protocols__init.<clinit>(Unknown Source)
at java.lang.Class.initializeClass(libgcj.so.10)
at java.lang.Class.forName(libgcj.so.10)
at clojure.lang.RT.loadClassForName(RT.java:1578)
at clojure.lang.RT.load(RT.java:399)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core__init.load(Unknown Source:5342)
at clojure.core__init.<clinit>(Unknown Source)
at java.lang.Class.initializeClass(libgcj.so.10)
at java.lang.Class.forName(libgcj.so.10)
at clojure.lang.RT.loadClassForName(RT.java:1578)
at clojure.lang.RT.load(RT.java:399)
at clojure.lang.RT.load(RT.java:381)
at clojure.lang.RT.doInit(RT.java:416)
at clojure.lang.RT.<clinit>(RT.java:302)
at java.lang.Class.initializeClass(libgcj.so.10)
at clojure.main.<clinit>(main.java:20)
at java.lang.Class.initializeClass(libgcj.so.10)
at java.lang.Class.forName(libgcj.so.10)
at java.lang.Class.forName(libgcj.so.10)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.VerifyError: verification failed at PC 214 in
clojure.core.protocols$fn__5393:invoke((Ljava.lang.Object;Ljava.lang.Object;Ljava.lang.Obje ct;)Ljava.lang.Object;): incompatible type on stack
at java.lang.Class.initializeClass(libgcj.so.10)
...25 more
I've followed the instructions on their github page, but no luck. I thought it would be fun to start learning clojure today but instead I've had nothing but problems, I don't even know what leiningen is, other than I apparently have to have it.
sorry about the frusteration,
Leiningen is a build tool to take the pain out of getting hacking on a new clojure project.
Before leiningen existed many people would try to "install" clojure by downloading a jar file out build it from source. Instead of doing any of that you just specify the version you want to use in the leiningen project.clj file and it installs it locally as a dependency for that project.
have you run:
lein new hello_clojure
cd hello_clojure
edit project.clj and set it to use clojure 1.3.0 :dependencies [[org.clojure/clojure "1.3.0"]
lein deps
lein repl
(+ 1 2 3 4)
When things go wrong with leiningen I generally:
lein upgrade
rm lib/*
lein deps
Problems like this are uncommon (for me) and usually fairly specific, so perhaps you would do well to drop into #clojure on irc.freenode.net and ask. It's a very friendly croud dont worry.

leiningen install lein-noir failed

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

How to install clojure-contrib on Windows?

I can't seem to find a way to launch the Clojure REPL with the contrib library included. If I understood the documentation correctly then this command should do it:
C:\clojure-1.1.0>"%ProgramFiles%\Java\jre6\bin\java.exe" -cp clojure.jar:clojure
-contrib.jar clojure.main
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: clojure.main. Program will exit.
But as you can see, it fails. I did copy the clojure-contrib.jar to the C:\clojure-1.1.0 folder.
Can someone help me get it right?
Update
Thanks to MichaƂ's post I noticed that my error was using a colon where I had to use a semi-colon. This works:
C:\clojure-1.1.0>"%ProgramFiles%\Java\jre6\bin\java.exe" -cp clojure.jar;clojure-contrib.jar clojure.main
Clojure 1.1.0
user=>
(Answer updated to make the actual solution explicit, whereas it was somewhat hidden in the original...)
The classpath string on Windows uses ; as the separator. E.g.
java.exe -cp "C:\clojure-1.1.0\clojure.jar;C:\clojure-1.1.0\clojure-contrib.jar" clojure.main
Alternatively, you can use a wildcard to include all jars in the given directory in the classpath (that's a JDK 1.6 addition, wouldn't work with 1.5):
java.exe -cp "C:\clojure-1.1.0\*" clojure.main
(I think using double quotes here is ok in Windows, can't check though...)