Reputation: 1538
Is there a way to set a .jar application as the default program to open .blah files on Mac OSX? I know how to set a .app as a default application, but the .app is the only file type not grayed out when you go to choose an application as a default.
What should I do about it?
Upvotes: 7
Views: 4090
Reputation: 168825
Launch the Jar using Java Web Start. The launch file provides the ability to set-up a file/content-type association. Here is a demo. of the file services that..
..prompts the user to associate file extension
.zzz
(simply a file type unlikely to clash with existing file associations) of content typetext/sleepytime
. ..
To do that at run-time in a JWS app., look to the IntegrationService
introduced in 1.6.0_18+.
JWS is designed to work on OS X (and Windows & *nix).
Upvotes: 1
Reputation: 205785
As discussed in Java Deployment Options for Mac OS X, you can create a Mac OS X Application Bundle that "can associate specific document types with your application. This lets users launch your application by double-clicking a document created by your application." See also more About Info.plist Keys.
Upvotes: 3