magwitch
magwitch

Reputation: 29

Clojure 1.9 command line tools - command not found clj.sh

I have just installed clojure 1.9 on my mac via Homebrew.

As expected I get 2 links in /usr/local/bin to the actual executables

clojure@ -> ../Cellar/clojure/1.9.0.358/bin/clojure

clj@ -> ../Cellar/clojure/1.9.0.358/bin/clj

running clojure from the command line works $ clojure Clojure 1.9.0 user=>

but for not for the command line tools $ clj zsh: command not found: clj.sh

both executable files exist $ ls Cellar/clojure/1.9.0.358/bin clj* clojure*

I've tried uninstalling clojure with brew uninstall and have deleted the cached version of clojure-tools-1.9.0.358.tar.gz in my ~/Library/Caches/Homebrew/ directory.

Installing it again was successful

    $ brew install clojure
    ==> Downloading https://download.clojure.org/install/clojure-tools-1.9.0.358.tar.gz ####### 100.0%
    ==> ./install.sh /usr/local/Cellar/clojure/1.9.0.358
    🍺  /usr/local/Cellar/clojure/1.9.0.358: 9 files, 19.4MB, built in 31 seconds

but still the same error.

Interestingly if I use the Finder to locate the file and double click on it, a new terminal window opens up and things seem to work.

    Last login: Tue Mar  6 10:35:48 on ttys002
    /usr/local/Cellar/clojure/1.9.0.358/bin/clj ; exit;                             
    $ /usr/local/Cellar/clojure/1.9.0.358/bin/clj ; exit;
    Clojure 1.9.0
    user=> 

Any ideas please on why this executable won't run directly from the command line?

Many thanks

Upvotes: 0

Views: 1664

Answers (1)

magwitch
magwitch

Reputation: 29

The problem was that I'd set up an alias for clj in my shell profile file which referenced a shell script called clj.sh that I'd written but which no longer exists - hence why nothing happened except an error message. Removing the alias from the shell profile file corrected the problem.

Upvotes: 1

Related Questions