0

I have a Java (Swing) application and I want to anchor it in the OS X dock. But, if I try do it, my app don't start correctly. Instead of it, a terminal is starting. Maybe, I must write script to run my app. Maybe, I must create *.app file for my app.

Can you advise some articles on how to anchor a Java application to the Mac OS X dock?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Jakeroid
  • 205
  • 2
  • 11
  • 1
    Perhaps you'd be better off using [Java Web Start](http://stackoverflow.com/tags/java-web-start/info) to install desktop shortcuts and menu items for the app. for any system that supports them. I doubt it is quite the same as 'adding an app. to the OS X dock', but it 1) is the next best thing 2) is supported by Oracle 3) has a chance of working on other systems. – Andrew Thompson Feb 17 '12 at 07:16
  • 1
    Like to hear that 'can do' attitude. :) To help you along with trying it, here are some [JWS examples](http://pscode.org/jws/api.html) which declare desktop-shortcuts but not menu items (from memory). Each demo. has downloadable source & support files and a build file (Ant based). It would only be another line or two in the [JNLP](http://stackoverflow.com/tags/jnlp/info) file to request a menu item. – Andrew Thompson Feb 17 '12 at 07:34

1 Answers1

2

Yes, you need to build an *.app package for your application. You can use the Jar Bundler - it should be supplied with Xcode (haven't used it for a long time, it came with the developer tools from the OSX install CD when I used it).

flyx
  • 35,506
  • 7
  • 89
  • 126
  • See also this [answer](http://stackoverflow.com/a/8956715/230513), and this [project](http://robotchase.sourceforge.net/). – trashgod Feb 17 '12 at 19:43