I'm looking for a way to call the system's default editor for xml files from a Java application. In other words, if I'm running on a Windows system, I might want to start Notepad, or if I'm on a Mac, maybe I want to start TextWrangler or oXygen, etc.
Essentially, I want to pass down an XML file to the system and have the underlying system determine the default editor, and then open the file in that editor.
I've seen some code using
Runtime.getRuntime().exec("cmd /c notepad.exe")
and the like, but that assumes
a) I know what the default editor for XML on the system is
b) I know the executable path for this file
I don't have a way of knowing either of those assumptions. Can anyone suggest ways for me to solve this bind?