Zuriar
Zuriar

Reputation: 11734

Installing leiningen 2 on Ubuntu

I have followed the instructions here:

leiningen.org

To install from the lein script. I now have:

~/.lein/self-installs/leiningen-2.4.3-standalone.jar

How do I now run leiningen? The instructions are not clear.

Upvotes: 18

Views: 19030

Answers (4)

Francieli
Francieli

Reputation: 11

If you are using a linux distribution you can just download the leiningen script and move it to your /bin folder. Once you've done that you can execute lein command and it will be installed for you. So from your terminal you can run:

$ curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > ~/lein

to download lein script to your root path. Then you set it as executable and move to your /bin folder

$ chmod x+a lein
$ sudo mv ~/lein /bin
$ lein

After you run the command lein from anywhere on your terminal the lein script will install leininge for your and you'll be able to use it normally.

Upvotes: 0

Chillar Anand
Chillar Anand

Reputation: 29514

On ubuntu, its quite easy. Download executable file, make it executable and place it in system path.

$ wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
$ chmod +x lein
$ sudo mv lein /usr/local/bin

You can also move it any directory which is in system path.

$ lein -v
Leiningen 2.6.1 on Java 1.8.0_77 Java HotSpot(TM) 64-Bit Server VM

Upvotes: 34

Naren Yellavula
Naren Yellavula

Reputation: 7673

I got the same doubt. Solved it. By following the instructions everything will be set for you. Next run the previously used script lein.sh in bin for creating projects as below.

suppose ~/bin/lein.sh is your script location ,then

$ ~/bin/lein.sh new test-project
$ ~/bin/lein.sh --help 

It will create the project in your bin folder it self.If you wish to access that lein.sh globally then include it in $PATH.

Upvotes: 1

soulcheck
soulcheck

Reputation: 36767

Posting this as it might help other users.

Follow the install instructions.

Please make sure the leiningen script that the install instructions is on your executable PATH.

The script is the entry point to leiningen commands, so it's still needed after the downloads are complete.

It takes care of setting up environmental variables, paths and everything else required to run leiningen, so you can use

lein <command>

instead of

java -cp <whatever>:~/.lein/self-installs/leiningen-2.4.3-standalone.jar ... clojure.main -m leiningen.core.main <command>

Upvotes: 9

Related Questions