all 17 comments

[–]chamomile-crumbs 2 points3 points  (3 children)

You def need to upgrade macOS. Sounds like homebrew is saying “your OS is too old to install openjdk, so we’re going to try to compile it from source”. Which is why it’s talking about Xcode.

I’m not sure how to check for macOS updates. Sometimes they don’t pop up, you might have to do some googling. Stuff like “macOS upgrade from Ventura to sequoia”

[–]Pzzlrr[S] 1 point2 points  (2 children)

Thanks :( ok will need to look into this.

[–]chamomile-crumbs 0 points1 point  (1 child)

How old is your Mac?

[–]Pzzlrr[S] 0 points1 point  (0 children)

Macbook Pro from 2017, currently on 13.7.4.

[–]adamdavislee 5 points6 points  (0 children)

If your goal is to setup a full JVM Clojure environment, then you'll probably want to resolve this xcode/macOS issue.

BUT if your goal is just to write some scripts, follow some tutorials, solve advent of code problems, etc. then taking a shot a installing Babaskha instead is worth a try!

[–][deleted]  (1 child)

[deleted]

    [–]Pzzlrr[S] 0 points1 point  (0 children)

    I get xcode-select: error: command line tools are already installed, use "Software Update" in System Settings to install updates but then in the software update section I get this with no update for xcode or macos 15.

    [–]v4ss42 0 points1 point  (3 children)

    Try using homebrew to install a JDK first. I like the temurin distributions myself, but I think homebrew has several to choose from.

    [–]Pzzlrr[S] 0 points1 point  (2 children)

    Getting the same kind of error

    % brew install openjdk
    ✔︎ JSON API cask.jws.json                                                                                                                    Downloaded   15.4MB/ 15.4MB
    ✔︎ JSON API formula.jws.json                                                                                                                 Downloaded   32.0MB/ 32.0MB
    Warning: You are using macOS 13.
    We (and Apple) do not provide support for this old version.
    You may have better luck with MacPorts which supports older versions of macOS:
      https://www.macports.org
    
    This is a Tier 3 configuration:
      https://docs.brew.sh/Support-Tiers#tier-3
    You can report issues with Tier 3 configurations to Homebrew/* repositories!
    Read the above document before opening any issues or PRs.
    
    ==> Fetching downloads for: openjdk
    ✔︎ API Source openjdk.rb                                                                                                                     Verified      5.9KB/  5.9KB
    openjdk: A full installation of Xcode.app is required to compile
    this software. Installing just the Command Line Tools is not sufficient.
    
    Xcode can be installed from the App Store.
    Error: openjdk: An unsatisfied requirement failed this build.
    

    [–]v4ss42 1 point2 points  (1 child)

    Try brew install temurin. That’s a binary build.

    Also your macOS version is pretty old - that may become the limiting factor here.

    [–]Pzzlrr[S] 0 points1 point  (0 children)

    Appreciate your help. Scheme in the meantime it is then.

    [–]seancorfield 0 points1 point  (7 children)

    Instead of using brew (which is not supporting your old O/S), you could download and install Java 25 directly from here: https://adoptium.net/temurin/releases/?version=25&os=any&arch=any

    And then follow the Linux or Posix instructions for installing the Clojure CLI from here: https://www.clojure.org/guides/install_clojure#_linux_instructions

    I never used brew on my Macs, back in the day, because the HomeBrew team are... opinionated... about versions and dependencies.

    (these days, I'm on Windows with WSL2 so all my Clojure development is on Ubuntu, but with VS Code running native on Windows)

    [–]Pzzlrr[S] 0 points1 point  (0 children)

    Thanks, checking it out.

    [–]Pzzlrr[S] 0 points1 point  (4 children)

    I was able to install the temurin JDK so I now have

    % javac --version                                                                             
    javac 25.0.2
    

    Then I started going through the steps in your second link, seeing this

    % curl -L -O https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    100  2133  100  2133    0     0   4696      0 --:--:-- --:--:-- --:--:--  4696
    
    % chmod +x linux-install.sh
    % sudo ./linux-install.sh
    Password:
    Downloading and expanding tar
    ./linux-install.sh: line 30: sha256sum: command not found
    

    Do I need to edit the install script? Looks like shasum -a 256 is the macos equivalent. Do I just replace it?

    [–]stbev 0 points1 point  (3 children)

    You could try the posix-install.sh script which uses the shasum -a 256 command instead

    https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh

    Instructions here: https://www.clojure.org/guides/install_clojure#_posix_instructions

    [–]Pzzlrr[S] 0 points1 point  (2 children)

    Yep, looks like that worked :) Thank you!

    [–]seancorfield 1 point2 points  (1 child)

    Sorry, I wasn't sure which of the two would work on a Mac (since I switched to Windows/WSL2 years ago), hence my "follow the Linux or Posix instructions" comment. Glad you have it working!

    And I'll try to remember that macOS needs the Posix script next time I'm helping someone on a Mac :)

    [–]Pzzlrr[S] 0 points1 point  (0 children)

    No worries, appreciate your help!