leiningen

How do I use the Clojure `use` function in leiningen?

泪湿孤枕 提交于 2019-12-12 06:39:54
问题 I am very new to both Clojure and Leiningen. I have installed Clojure on Windows at C:\clojure-1.5.1 and leiningen-win-installer beta1 at C:\.lein\bin . Now I am trying the example from Eric Rochester's book. I have included dependent libraries for Incanter in project.clj and also using dep. How do I use the command (use 'incanter.core) ? I am getting 'use' is not recognized as an internal or external command . In addition, how do I use lein commands at user=> ? 回答1: Edit - I forgot "lein

Lein REPL always shows Connection Refused

别说谁变了你拦得住时间么 提交于 2019-12-12 04:37:29
问题 I've been trying to get Leiningen to work on my Mac. However whenever I run "lein repl" I get the following response: localhost:~ KJ$ 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:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect

riemann.io add jar to classpath

那年仲夏 提交于 2019-12-11 13:56:23
问题 I have written custom clojure functions that I want to use in my riemann configuration. I am using leiningen to build jar file (with dependencies) containing my functions. What is the right way to include this jar file in the classpath when starting riemann ? 回答1: I have only found this way. I'm not sure whether this is the right way : java -cp "/path/to/my/custom.jar:/path/to/riemann-0.2.6/lib/riemann.jar" riemann.bin /path/to/riemann-0.2.6/etc/riemann.config 回答2: I think, you can config:

Could not locate Clojure resource on classpath

天大地大妈咪最大 提交于 2019-12-11 11:39:20
问题 I am trying to access some of my clojure functions in my Java code (I am using Eclipse and CounterClockWise). Firstly, I was not sure how to do it? But then I found some answer here. I am using clojure.lang.RT package for calling .clj files in my Java code. While naming namespaces, .clj files proper conventions has been followed like ns test.clojure.core is in test.clojure package where-in core is .clj file. Also upon following some information, I have added java-source-path (i.e. java-source

leiningen not working on os x

风流意气都作罢 提交于 2019-12-11 04:06:51
问题 When I try running leiningen on my os x lion I get the error below. The install is done as per the instructions on github (README). Can anyone give me a hint on this? The only possible solution I found via google was to run lein clean but that fails for me with a similar message. Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lang

cannot run lein script

試著忘記壹切 提交于 2019-12-11 04:04:45
问题 I've downloaded lein , put it in my /bin folder, and made it executable. I've also downloaded java: $java -version java version "1.7.0_65" But I get the following error upon running the command: $lein java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry at clojure.lang.APersistentMap$ValSeq.first (APersistentMap.java:185) clojure.lang.RT.first (RT.java:577) clojure.core$first.invoke (core.clj:55) clojure.core$map$fn__4245.invoke (core.clj:2559) clojure.lang

How to use common dependencies in different clojurescript projects?

喜夏-厌秋 提交于 2019-12-11 02:35:13
问题 I wrote a clojurescript project. It is a reagent component. Now i want to use this component in other clojurescript project. That is what i do: I compiled my cljs project and then i put a result compiled file to js folder in other project. Further i require that file from index.html. At the end i invoke my component from cljs file (.slider-view (.-views js/swipe) (clj->js [[:p "1"] [:p "2"] [:p "3"]])) and it works. But i have a question. My project and project where i connect my component

Add webapp frontend to existing clojure app

守給你的承諾、 提交于 2019-12-10 19:55:48
问题 I have a Clojure-based chat bot that I start up in typical leiningen fashion with lein run . I'd like to add a front end to this app, but not totally sure how to go about it. From reading docs on compojure, lib-noir and ring, looks like the standard way to serve is with lein ring server . I'd rather just start up the app and the front end with a single lein command if possible. Would this involve manually starting up the server (in another thread perhaps) with something like (run-jetty

Workflow for hacking on Clojure libraries using swank-clojure

╄→гoц情女王★ 提交于 2019-12-10 16:11:53
问题 Is there a typical workflow for hacking on Clojure libraries? Say I have my application "Foo" which relies on a third-party library "Bar", which was obtained from a repository, and included in project Foo via lein deps . Then, say I want to hack on library "Bar", so I clone it from github. Now, I would like to hack on my local clone "Bar" while at the same time working on application "Foo" that depends on it. I would like all of the source files for "Bar" to open in Emacs along with all the

how to add a hook into the uberjar process (building with lein)

坚强是说给别人听的谎言 提交于 2019-12-10 16:10:39
问题 i would like to add a hook to the uberjar process. the specific example is to download the maxmind geoip dat file into the resources folder so an updated version is bundled into the jar every time it deploys. examples/suggestions appreciated thanks! 回答1: I recommend making a custom lein task that calls uberjar, rather than using a hook. For example, if your project is called foo: file: foo/tasks/leiningen/foobuild.clj (ns leiningen.foobuild (:require leiningen.uberjar)) (defn foobuild