I'm using Ubuntu 12.04. I have a file with an extension .sbd and I have a jar file (that I've written) that can open these extensions. However, I want to be able to click on the .sbd file and have the jar file open it. The issue is the open with tab in the .sbd file's properties won't let me browse for the jar file. How can I do this?
1 Answer
The solution was to first create a mime type for my custom file format using the answer for this question: https://stackoverflow.com/questions/30931/register-file-extensions-mime-types-in-linux
Then I had to create a .desktop file for my application that looks something like this:
[Desktop Entry]
Name=My Application
Type=Application
Exec=java -jar /path/to/my-application
Finally, I had to register my mimetype with the desktop file by adding the following line to /usr/share/applications/defaults.list:
application/x-my-mime-type=my-application.desktop