I would like to add an action to my
java application that takes a user to a specific directory when they click on the toolbar icon. For users using Windows, this is easy since I can just call explorer.exe from the command line. However, I don't know the equivalent in Mac OS or Linux. Can anyone help with this? I think in mac, I can use /usr/bin/open?
if (System.getProperty("os.name").beginsWith("Windows"))
{
Runtime.getRuntime().exec("explorer.exe " + path);
} else if (System.getProperty("os.name").indexOf("Linux")!=-1)
{
// What goes here?
} else if (System.getProperty("os.name").beginsWith("Mac"))
Runtime.getRuntime().exec("usr/bin/open" + path); // is this right?
...