How do I find out the user's "preferred web browser", if they're using Gnome desktop environment? (I want to open a webpage, I don't need to know which browser the user prefers.)
Some background: I'm trying to open a browser window (my homepage) with my Java app.
- if Java version is 1.6+, use Desktop.browse(url);
- otherwise, use BareBonesBrowserLaunch.openURL(url) - that means checking the environment and starting a browser with Runtime.getRuntime().exec()
Method 2 works on Windows just fine; and opens a browser on Linux. However, it's the first browser that it finds (in my case, looks for Firefox first). In Gnome desktop environment (e.g. Ubuntu Linux has that by default), you could set your "Preferred Applications" for e-mail, www browsing etc; I believe this information is accesible somewhere. How can I find out which is the user's preferred browser?
In other words: where does Gnome store the "Preferred Browser" setting?