<p>I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the <a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/" rel="noreferrer">Desktop API</a>, but I need a solution for <strong>Java 1.5</strong>.</p>

<p>So far I found a way to do it in Windows:</p>

<pre><code>Runtime.getRuntime().exec(new String[]{ "rundll32", 
                          "url.dll,FileProtocolHandler", fileName });
</code></pre>

<p>Is there a cross-platform way to do it? Or at least a similar solution for <strong>Linux</strong>?</p>

SWT
gives you the possibility to lokk for the standard program to open a file via:
```
```
final Program p = Program.findProgram(fileExtension);
p.execute(file.getAbsolutePath());
```
```
Strictly this isn't Cross-Platform since SWT is platform dependent, but for every platform you can use a diffenrent SWT jar.