zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 13
Runtime.exec isn't going to do what you need.
Assuming you are on Java 1.6 or 1.7 (which you should be) you can use the new Desktop class to open any arbitrary file in whatever application the OS associates with that file type (eg Image Viewer for jpegs).
This tutorial tells you everything you could possibly want to know (and a lot more)...
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/
but the short version is:
Desktop d = Desktop.getDesktop();
File f = new File("H:\\Profile\\Desktop\\dwarves\\Doc.jpeg");
d.open(f);
JamesCherrill
... trying to help
8,506 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29