How to open the file from java Desktop-application using the default
Windows application?
Except the variants: JDIC and java.awt.Desktop and
Runtime.getRuntime().exec().
JDIC is not working for 64-bit systems.
java.awt.Desktop is not working on some computers.
Now that java.awt.Desktop is bundled with the JDK, JDIC has had the
rug pulled out under it. I suppose the way to proceed is to submit bug
reports for java.awt.Desktop. This is highly platform specific code,
so you will need to pester all the JVM vendors.
see
http://mindprod.com/jgloss/desktop.html
http://mindprod.com/jgloss/jdic.html
What to do in the meantime? You could write your own platform
specific code on how to launch a few filetypes. The idea of Extension
being a clue to file type is a fairly Windowsy idea. Other ways it can
be done:
1. embedded signature in the first bytes of the file.
2. something in the directory, e.g. a MIME type.
3. something in a second fork of the file.
It is a bit of a mess to work out a standard API to launch that can
cover all this ad hoc crap.
I just want to spit and kick somebody every time I realise there is no
mechanism to keep track of the encoding of a file, which is a symptom
of the same never-change-your underwear geek think.
What were these assholes thinking?
--
Roedy Green Canadian Mind Products
http://mindprod.com
The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair.
~ Douglas Adams (born: 1952-03-11 died: 2001-05-11 at age: 49)