J
JScoobyCed
Hi,
A few months ago, a post was asking how we can open a document on a Mac
OS X from a Java application.
Since wednesday I try to use all the methods proposed and found on
internet, without success.
I would like to (for example) open a PDF file in the PDF Viewer (or any
program registered to open PDF file).
I have triied:
Runtime.getRuntime().exec("open \"/Volumes/Tiger/user1/Doc1.pdf\"");
or
String[] c = new String[]{"open", "\"/Volumes/Tiger/user1/Doc1.pdf\""};
Runtime.getRuntime().exec(c);
and even using the MRJUtils.jar package:
File file = MRJApplicationUtils.findApplicationHandler(new
MRJOSType("pdf"));
String cmd = file.getPath() + "\"/Volumes/Tiger/user1/Doc1.pdf\"";
Runtime.getRuntime().exec(cmd);
(also triied with array cmd = new String[] {file.getPath(), ...} )
Somebody please help I don't want to open only PDF, but DOC, PPT,
GIF, HTML, any file registered to the OS (eventually, with the
MRJUtils.jar, I can register new file to programs, though I didn't test
yet )
Thank you
A few months ago, a post was asking how we can open a document on a Mac
OS X from a Java application.
Since wednesday I try to use all the methods proposed and found on
internet, without success.
I would like to (for example) open a PDF file in the PDF Viewer (or any
program registered to open PDF file).
I have triied:
Runtime.getRuntime().exec("open \"/Volumes/Tiger/user1/Doc1.pdf\"");
or
String[] c = new String[]{"open", "\"/Volumes/Tiger/user1/Doc1.pdf\""};
Runtime.getRuntime().exec(c);
and even using the MRJUtils.jar package:
File file = MRJApplicationUtils.findApplicationHandler(new
MRJOSType("pdf"));
String cmd = file.getPath() + "\"/Volumes/Tiger/user1/Doc1.pdf\"";
Runtime.getRuntime().exec(cmd);
(also triied with array cmd = new String[] {file.getPath(), ...} )
Somebody please help I don't want to open only PDF, but DOC, PPT,
GIF, HTML, any file registered to the OS (eventually, with the
MRJUtils.jar, I can register new file to programs, though I didn't test
yet )
Thank you