I am trying to open *.docx files programmatically from Java on Mac OS X. For Windows and Linux I already got it working with the following methods:
Windows:
Runtime.getRuntime().exec(new String[] {"C:\Program Files\Microsoft Office\Office15\WINWORD.EXE", "document.docx"});
Linux:
Runtime.getRuntime().exec(new String[] {"/bin/sh", "-c", "/usr/bin/libreoffice", "document.docx"});
How does it work with Mac OS X ? My Microsoft Office installation is at the following location:
/Applications/Microsoft Office 2011/Microsoft Word.app
Any ideas highly appreciated - thanks.