You should be able to use:
Program.launch(file);
to open the file (using the default application or creator). From javadoc:
Runs the operating system executable file associated with the file or URL (http: // or https: //). If the file is executable, then the executable is launched. Note that a Display
already exists to ensure that this method returns the appropriate result.
Please note that there are some features in Program.launch()
(or at least there were, although they may have been fixed in later versions of the runtime.) I really donβt remember the specifics of the errors, but we do some checks for solutions to some problems:
If you are on a Unix platform and specify an absolute path, there may be a problem opening this file. We prefix absolute paths with /.
- so that /tmp/foo
will be translated to /./tmp/foo
- although I really don't remember the specifics of this error anymore.
On Windows, if you are trying to open a UNC path - for example, \\server\bar
- you need to wrap the string in double quotes. For example: Program.open("\"\\server\bar\"");
source share