Search code examples
clojureclojure-java-interop

How do I get the Dock icon to appear for a Clojure app on a mac?


Currently nothing (not even the java coffee cup) appears.

I created my app using lein new reagent name and I've tried these jvm options:

java -Xdock:name=Name
     -Xdock:icon=/Users/bmaddy/Downloads/logo.jpg
     -Dapple.awt.UIElement=true
     -Djava.awt.headless=false
     -jar name.jar

Solution

  • It turns out that just using Seesaw does something that makes the dock icon appear. That's good enough for what I need.

    (ns name.server
      (:use seesaw.core)
    

    Other stuff I tried:

    The automator method described here only gave an icon to start the app and it didn't stick around while it was running: https://discussions.apple.com/thread/4805123

    There's some good ideas here, but I wasn't able to get any of them to work: https://apple.stackexchange.com/questions/191609/how-to-create-a-app-folder-from-an-executable-jar

    Building an .app package from scratch led to a bunch of LSOpenURLsWithRole() failed with error -10810 errors I wasn't able to solve, but that seems like it would be the most correct way to do it.