How does one start programming with Clojure in Windows?
Asked Answered
C

2

13

I know it is possible to use CounterClockwise inside Eclipse, but I have been trying to get Leiningen to work so that I could use ClojureScript.

I downloaded leiningen using git clone. It then says run the script. I have tried lein self-install from inside PowerShell and inside the git bash environment.

In each I get an error about failing to download leiningen (which I thought I had with the git clone? hmm). It is interesting because one reads instructions that include things that don't make sense to Windows.

For example, inside Powershell, Windows doesn't understand export HTTP_CLIENT. It was only inside the git bash that I got a message that it is possible my HTTP client's certificate store does not have the correct certificate authority.

It then suggests this command, which runs ok, export HTTP_CLIENT="curl --insecure -f -L -o" but it doesn't fix the problem.

Curren answered 12/4, 2013 at 1:45 Comment(0)
B
9

The most recommended method AFAIK is to download the script lein.bat and putting it on the PATH environment variable. I've tested this method on several systems (XP, Windows 7). There is no need to build leiningen from a git checkout yourself. If you have a Windows with Powershell installed lein self-install should download the core .jar file inside a directory .lein in your user directory. Else, make sure you install either wget.exe or curl.exe and put it on the PATH.

Benghazi answered 12/4, 2013 at 5:50 Comment(4)
I would only add that it's useful to read lein.bat if you want to see how to modify where lein installs itself when you run lein.bat.Sergo
For some reason, I ran into a problem with that, or the next step. I have the directory containing lein and curl as well as wget on the path. Do I need to put c:\bin\lein\lein.bat on the path, or just up to the folder where lein exists?Curren
For some reason, I ran into problems. I have the directory containing lein and curl as well as wget on the path. Do I need to put c:\bin\lein\lein.bat on the path, or just up to the folder where lein exists? If I use cygwin is it a different file that I download instead of lein.bat? Anyway, when I ran lein self-install it just moved one file, as I had tried to do this earlier. Then I tried > lein new mytest and it downloaded a lot, but stopped with error: Could not find artifact leiningen-core:leiningen-core:jar:2.2.0-SNAPSHOT in clojars( clojars.org/repo ).Curren
The PATH only contains directories, separated by semicolons. I suggest you enter #clojure or #leiningen on Freenode IRC, so people can assist you while you try further.Benghazi
R
1

There is an installer for Leiningen on Windows. You just need to install Java SE 7 JDK and Leiningen for Windows. This page has detailed instructions with screen shots: http://leiningen-win-installer.djpowell.net/

Leiningen for Windows creates a PATH variable and Clojure REPL shortcut among other things. From the REPL you can create, build, and automate your Clojure project.

Riggins answered 15/10, 2013 at 13:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.