For one of my CS classes we're learning about Clojure and in order to do so, we of course need to set up our computers so that they can run Clojure. My professor's instructions were as follows:
"If you would like a nice IDE for Clojure, I recommend the following:
Install the Java Development Kit (JDK) newest version
Install Leiningen: leiningen.org
Install IntelliJ IDEA. When installed, install the "Cursive" plugin for Clojure syntax highlighting."
Firstly, if this helps at all I am on macOS Sierra. I already have the JDK installed, so I went straight to the second step: installing leiningen. Per the instructions listed on the site for installing leiningen, I downloaded the lein script, and moved it to ~/bin. I then tried chmod a+x ~/bin/lein which didn't really do anything, or at least I wasn't informed that it did anything.
The next step on leiningen.org was to run the script, so I used ./lein which ran, but when I entered lein into the terminal the terminal prompted me with: -bash: /usr/local/bin/lein: No such file or directory. I then tried a bunch of different things to try to get lein to work but in the end I ended up using brew install leiningen which I should have done in the first place, but totally forgot that I had homebrew installed.
I don't really remember when this started happening but every time I open up a new terminal window I'm greeted with:
Last login: Tue Oct 18 16:46:04 on ttys000
.clojure.lein.swp: Permission denied
Michaels-MacBook-Air:~ Michael$
Terminal still seems to work perfectly fine, but the .clojure.lein.swp: Permission denied is really bothering me, and I can't figure out how to fix it. I've tried uninstalling leiningen but it didn't seem to work. If it helps at all, here is my terminal history from when I was trying to get leiningen to work:
389 cd /Users/Michael/Documents/
390 chmod a+x ~/bin/lein
391 chmod a+x ~/bin/lein.txt
392 chmod a+x /lein
393 chmod a+x ~ /lein
394 chmod a+x ~/lein
395 chmod a+x ~/Documents/lein
396 chmod a+x ~/Documents/lein.txt
397 ./lein
398 cd ~/bin
399 cd bin
400 ls
401 chmod a+x ~/Documents/lein.txt
402 chmod a+x ~/Documents/lein
403 lein
404 cd ~
405 pwd
406 (chmod a+x ~/lein)
407 (chmod a+x ~/lein.txt)
408 lein.txt
409 ./lein.txt
410 lein -version
411 lein help $TASK
412 lein
413 lein new app my-stuff
414 -o
415 ./lein
416 ./lein.txt
417 lein help
418 lein help $TASK
419 echo $PATH
420 (chmod a+x ~/lein)
421 lein
422 $echo $PATH
423 cd /bin
424 pwd
425 cd /usr/local/bin/
426 chmod a+x ~/bin/lein
427 chmod a+x /usr/local/bin/lein.txt
428 ./lein.txt
429 lein
430 lein
431 lein self-install
432 .//Users/Michael/.lein/self-installs/leiningen-2.7.1-standalone.jar
433 cd /Users/Michael/.lein/self-installs/
434 pwd
435 ls
436 ./leiningen-2.7.1-standalone.jar
437 sudo ./leiningen-2.7.1-standalone.jar
438 lein
439 echo $PATH
440 mkdr /Applications/clojure
441 mkdir /Applications/clojure
442 cd /Applications/clojure
443 sudo curl-o
444 sudo curl-O
445 sudo curl -O https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
446 sudo chmod a+x lein
447 cd /etc/paths.d/
448 sudo vi clojure.lein
449 echo $PATH
450 sudo vi clojure.lein
451 echo $PATH
452 lein
453 lein repl
chownwill help (however might not be recommended). What is the user that owns the command you are trying to run? What are the permissions given to other users? - Chris Murphy