Compilation error in eclipse [counterclockwise plugin] - clojure

I am getting this error whenever i try to run project.clj file:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: defproject in this context,
I figured it out that the problem is with leiningen as i am also not able to create any projects in repl as well:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: lein in this context,
Thought there might be a problem with counterclockwise plugin and re-installed, but same error.

Related

Clojure unable to resolve symbol in repl

I'm doing the Exercise 4.12 in Packt Publishing's The Clojure Workshop (source code on Github).
The instructions were to create a deps.edn file and a tennis.clj file and in an REPL (I'm using clj) type the following:
(in-ns 'packt-clj.tennis)
(first-match "match_scores_1991-2016_unindexed_csv.csv")
When I try to call firs-match, whether in ./ ./src/ or ./src/pakt_clj/ I get the error
Unable to resolve symbol: first-match in this context
Any help in getting this to work is much appreciated.

leiningen project: repl-options/init

When I add :repl-options {:init (print "x..")} to ~/.lein/profiles.clj it does what it should on every repl start-up. however, when I add the same to my local project.clj, I receive this error:
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: do in this context, compiling:(/tmp/form-init5885833654225579206.clj:1:886)
I'm using leiningen 2.5.3
I've stumbled across this issue as well - I tried to use multiple profiles, each with its own :repl-options.
The issue is that Leiningen doesn't merge `:init: correctly. You can refer to this issue for more details.
Unfortunately, I couldn't find any fix that would work for me. And the issue itself won't be fixed till Leiningen 3.0.

Geting error using seesaw on the lein repl

Trying to go through this tutorial for seesaw gui library i get the following error as i run lein repl.
Any ideas what the problem is and how to fix it?
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
WARNING!!! version ranges found for:
[seesaw "1.4.2" :exclusions [org.clojure/tools.trace]] -> [j18n "1.0.1"] -> [org.clojure/clojure "[1.2,1.5)"]
Consider using [seesaw "1.4.2" :exclusions [org.clojure/clojure org.clojure/tools.trace]].
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Error loading cider.nrepl.middleware.apropos: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.classpath: java.lang.RuntimeException: Unable to resolve symbol: response-for in this context, compiling:(cider/nrepl/middleware/classpath.clj:15)
Error loading cider.nrepl.middleware.complete: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.debug: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.format: java.lang.RuntimeException: Unable to resolve symbol: defprotocol+ in this context, compiling:(deps/cljfmt/v0v1v10/deps/rewrite_clj/v0v4v12/rewrite_clj/node/protocols.clj:9)
Error loading cider.nrepl.middleware.info: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.inspect: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.macroexpand: java.lang.RuntimeException: Unable to resolve symbol: response-for in this context, compiling:(cider/nrepl/middleware/macroexpand.clj:73)
Error loading cider.nrepl.middleware.ns: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.pprint: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.refresh: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.resource: java.lang.RuntimeException: Unable to resolve symbol: defsource in this context, compiling:(deps/compliment/v0v2v4/compliment/sources/resources.clj:42)
Error loading cider.nrepl.middleware.stacktrace: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.test: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(cider/nrepl/middleware/util/cljs.clj:57)
Error loading cider.nrepl.middleware.trace: java.lang.RuntimeException: Unable to resolve symbol: response-for in this context, compiling:(cider/nrepl/middleware/trace.clj:16)
Error loading cider.nrepl.middleware.undef: java.lang.RuntimeException: Unable to resolve symbol: response-for in this context, compiling:(cider/nrepl/middleware/undef.clj:19)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context, compiling:(/tmp/form-init2232335588436189028.clj:1)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6416)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
at clojure.lang.Compiler.analyze(Compiler.java:6177)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3503)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6411)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
at clojure.lang.Compiler.analyze(Compiler.java:6177)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3503)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6411)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
at clojure.lang.Compiler.access$100(Compiler.java:37)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5837)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
at clojure.lang.Compiler.analyze(Compiler.java:6177)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5008)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3629)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6407)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
at clojure.lang.Compiler.eval(Compiler.java:6462)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.Compiler.loadFile(Compiler.java:6863)
at clojure.main$load_script.invoke(main.clj:282)
at clojure.main$init_opt.invoke(main.clj:287)
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.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context
at clojure.lang.Util.runtimeException(Util.java:156)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:613)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
... 34 more**
You have this error:
Unable to resolve symbol: some->
some-> has been added in clojure 1.5
Your project.clj, which you wrote in a comment (you should've added to question by editing it... leaving it into the comments is almost unreadable and hostile to people that might be willing to help you) is:
(defproject sisaw "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0" ]
[seesaw "1.4.2-SNAPSHOT"]])
seesaw apparently is built upon clojure 1.4 [1] [2]
Leiningen is telling you:
WARNING!!! version ranges found for: [seesaw "1.4.2"] -> [j18n "1.0.1"] -> [org.clojure/clojure "[1.2,1.5)"] Consider using [seesaw "1.4.2" :exclusions [org.clojure/clojure]]
I understand [1.2,1.5) to mean a range from 1.2 to 1.5 with 1.2 included, 1.5 excluded
This means that a transitive dependency of seesaw prevents you from having clojure 1.5 as a dependency
Leiningen suggests to use [seesaw "1.4.2" :exclusions [org.clojure/clojure]] in your dependencies, so that the version resolution will pick up the one specified somewhere else (in your project.clj in this case) and ignore/exclude the one derived from seesaw (transitive) dependencies
I don't know if this is the only problem that you have, but it should at least partly explain it

Another error trying "lein ritz" - Unable to resolve var: main/warn-chaining in this context, compiling:(ritz/swank/project.clj:98:11)

After solving this error I am now getting another error running lein ritz:
Caused by: java.lang.RuntimeException: Unable to resolve var: main/warn-chaining in this context, compiling:(ritz/swank/project.clj:98:11)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6567)
at clojure.lang.Compiler.analyze(Compiler.java:6361)
at clojure.lang.Compiler.analyze(Compiler.java:6322)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3573)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
at clojure.lang.Compiler.analyze(Compiler.java:6361)
at clojure.lang.Compiler.analyze(Compiler.java:6322)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5708)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6009)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
at clojure.lang.Compiler.analyze(Compiler.java:6361)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6548)
at clojure.lang.Compiler.analyze(Compiler.java:6361)
at clojure.lang.Compiler.analyze(Compiler.java:6322)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5708)
This looks like you're running lein ritz outside of a project directory.
New versions of ritz will warn:
Couldn't find project.clj, which is needed for ritz
But lein ritz-nrepl still results in an uncaught java runtime exception:
Unable to resolve var: main/warn-chaining in this context
Solution: cd to your project directory, and try again from there.

clojure.contrib.duck-streams FileNotFoundException, why?

user=> (use '[clojure.contrib.duck-streams])
java.io.FileNotFoundException: Could not locate clojure/contrib/duck_streams__in
it.class or clojure/contrib/duck_streams.clj on classpath: (NO_SOURCE_FILE:0)
Clojure.contrib is in CLASSPATH still it is throwing Exception. Do I need some other Jar?
Use clojure.java.io instead, it's included with 1.2.
I highly recommend using leiningen to sort this out.
try the lein repl command to get a quick repl with a working classpath.
According to this message:
http://osdir.com/ml/clojure/2010-10/msg00834.html
clojure.contrib.duck-streams has been deprecated.