Runtime.exec() command to open default pdf reader
843798Mar 21 2005 — edited Oct 4 2005Hello
I want to launch a pdf-file (from within the code) on the system default pdf-reader. Can I somehow retrieve the path to the default pdf-reader and use it like this:
String pdfReaderPath = retrievePDFreaderpath(); // ????
String filename = new String("E:\\Test.pdf");
String[ ] open = {pdfReaderPath , filename};
try {
Process proc = Runtime.getRuntime().exec(filename);
} catch (IOException e) {
e.printStackTrace();
}
Thank you!