0

I was installing Clojure on a Mac running OS X Yosemite (10.10.5). Following the recommended procedure, I first installed Leiningen. While running lein deps for the first time, I got a series of errors such as this:

Could not transfer artifact org.clojure:clojure:pom:1.8.0 from/to central (https://repo1.maven.org/maven2/): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

The same baffling error message appears in a number of other StackOverflow questions relating to specific software other than Leiningen, Clojure, and OS X and the accepted answers in those cases appear to be very different from what worked for me (e.g. Error - trustAnchors parameter must be non-empty), so I have created a new question for this specific problem to help others trying to install Clojure on a Mac.

Community
  • 1
  • 1
Westcroft_to_Apse
  • 1,503
  • 4
  • 20
  • 29

1 Answers1

0

The problem seems to be with the Java runtime that comes with OS X Yosemite.

First get rid of all the Java Virtual Machines installed:

sudo rm -rf /Library/Java/JavaVirtualMachines/*.jdk

Then install a reliable Java runtime with the Mac package manager, Homebrew:

brew update
brew cask install java

After this, simply enter lein deps again - it then works fine (or at least, it did for me).

Westcroft_to_Apse
  • 1,503
  • 4
  • 20
  • 29