1

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
bmaddy
  • 876
  • 9
  • 16

2 Answers2

1

Why not use Java interop ? Following this SO post question :

// let's translate this
import com.apple.eawt.Application;
...
Application application = Application.getApplication();
Image image = Toolkit.getDefaultToolkit().getImage("icon.png");
application.setDockIconImage(image);

// into Clojure
(import com.apple.eawt.Application java.awt.Toolkit)
(let [app (Application/getApplication)
      image (.getImage (Toolkit/getDefaultToolkit) "icon.png")]
   (.setDockIconImage app image)))
Community
  • 1
  • 1
nha
  • 17,623
  • 13
  • 87
  • 133
  • The `.setDockIconImage` call returned `nil` so I suspect it successfully changed the image, but I still can't see the icon on the dock. – bmaddy Nov 11 '15 at 16:07
0

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.

bmaddy
  • 876
  • 9
  • 16