Installing Leiningen from a proxy – on Windows!

A quick note on how to do this, as I had a few issues.

Leiningen comes as a unix shell or windows batch script with some functionality embedded in it to download and install dependencies.  Actually, this is just a single uber-jar these guys have created containing clojure.  Download the script from:

Put it somewhere sensible.  Add the folder containing it to your windows PATH.

Create LEIN_JAR as an environment variable and set it to a local foldername, somewhere where you will put this jar.

Now both the shell and batch scripts use wget, the unix command for HTTP requests.  So I installed cygwin to support this.  This is where the proxy provides a few problems.  Cygwin needs to know about it.

You need your proxy hostname and port number.

Create two files in your cygwin home folder, under the cygwin install, e.g. C:\apps\cygwin\home\<username>


export HTTP_CLIENT="wget --no-check-certificate -O" # 
export http_proxy=$proxy
export https_proxy=$proxy
export HTTP_PROXY=$proxy
export HTTPS_PROXY=$proxy



Now start a cygwin shell (i.e. ‘bash’ from a commandline will do) and do lein self-install and all should be well.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s