Clojure version and quil

194 views
Skip to first unread message

Jerome Manceau

unread,
Sep 6, 2016, 7:00:35 AM9/6/16
to Clojure
Hi,

I'm very new to Clojure and hitting a wall trying to use quil.

I've created a new project following an example "lein new quil drawing"
It seemed to work but when checking the project.clj I saw that the quil dependency was missing.
Also, trying to start a first test application would only throw errors.

Now, I realised that I need clojure version >= 1.7 to have quil working.
But that's where it gets confusing:

- When typing "clojure" in my terminal, I get : Clojure 1.4.0

- When starting "lein repl" and then typing "(clojure-version)", I get: "1.2.1"

- When using the REPL on my IDE (NightCode) and typing "(clojure-version), I get: "1.9.0-alpha11"

So, how do I upgrade the clojure version in leiningen, so that I can call "lein new quil drawing" and get the project created properly?

I'm working on ubuntu 14.4

Thanks for help

Nikita Beloglazov

unread,
Sep 7, 2016, 10:49:51 AM9/7/16
to Clojure
Hi Jerome

That's odd. Can you post project.clj generated from "lein new quil drawing"? In my case it generates this: https://gist.github.com/nbeloglazov/511afe2e43213b0ae7bb51ec73e20169

What version of lein do you have (run "lein version")? 

Nikita

Mars0i

unread,
Sep 8, 2016, 12:40:29 AM9/8/16
to Clojure
The general principle is that the Clojure version that you get when you run 'lein repl' will be the one specified in the project.clj file in the directory you're in when you run 'lein repl'.  (Nikita's link illustrates how the Clojure version is specified in project.clj.)  When you run 'clojure' in your terminal, you're getting whatever script named "clojure" is first in your path.  You can see what your path is with a command such as 'echo $PATH'.  NightCode may have it's own way of specifying the version to use, but I don't use NightCode, so I don't know.

Are you in the drawing directory when you run 'lein repl'?  If not, then you're not getting the version of Clojure specified in drawing/project.clj.  You're just getting whatever version of Clojure is the default for the version of Leiningen that's installed.

If you are in drawing when you run 'lein repl', then I wonder, like Nikita, what version of Leiningen you have.  However, you should be able upgrade to the latest version of Leiningen by running 'lein upgrade' at a shell prompt.  You would still want to run 'lein repl' from the directory that was created by 'lein new quil drawing', though, in order to work with quil.

Jonathan Fischer

unread,
Sep 8, 2016, 9:49:54 AM9/8/16
to Clojure
You're probably using the leiningen that's packaged in Ubuntu, right? On Ubuntu 14.04, that's pulling in version 1.7.x, which is positively ancient. Remove the apt packaged version of leiningen and follow the installation instructions on the website (http://leiningen.org) and you'll probably be good to go.
Reply all
Reply to author
Forward
0 new messages