Installing leiningen 2 on Ubuntu
Asked Answered
S

4

18

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.

Stevenage answered 14/9, 2014 at 21:25 Comment(6)
you have step-by-step instructions hereGalloping
thanks, I have followed those instructions step-by-step. However, when I run 'lein' I get nothingStevenage
do you have lein script in your PATH?Galloping
no, I deleted it after it downloaded the self-install.. I assumed it was just the download scriptStevenage
No, you still need it. The script is the entry point to everything leiningen.Galloping
I did the same thing!Dodiedodo
G
9

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>
Galloping answered 14/9, 2014 at 22:26 Comment(0)
W
34

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
Whimsey answered 29/4, 2016 at 14:19 Comment(1)
Or I could just do sudo apt install leiningen Hammered
G
9

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>
Galloping answered 14/9, 2014 at 22:26 Comment(0)
I
1

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.

Imprest answered 27/3, 2015 at 12:7 Comment(1)
// , Where do you get ~/bin/lein.sh in the first place? This answer raises more questions.Headmost
C
0

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.

Conlon answered 12/11, 2017 at 16:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.