recent sun java 6 bug clobbers openoffice mime file associations - how to fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey all,

I was bit by a bug yesterday involving sun's java jdk 6 and openoffice
on fedora 6 (this bug also applies to other distros, however). I'm
posting how i fixed it here, for the possible benefit to others. I
didn't see anyone else mention it on this list, so i apologize in
advance if this information is later found to be redundant here. 

I don't know if this bug applies to the jre, since i haven't had time to
test it. I also noticed that jdk 6u1 is now available on java.sun.com,
so this might have been fixed (tho a cursory look at the release notes
and such didn't look too promising).

<buginfo>At some point, after installing sun's jdk 6 and the jpackage
compatibility package, i tried to open an opendocument spreadsheet
(.ods) file by double-clicking the file in the nautilus file manager, to
be taunted with an error:

"(red X) Cannot open my_spreadsheet.ods

The filename "my_spreadsheet.ods" indicates that this file is of type
"ODS spreadsheet". The contents of the file indicate that the file is of
type "Java Archive". If you open this file, the file might present a
security risk to your system." It then goes on to suggest that you can
use the "Open with" to choose a specific application for the file, blah
blah blah.

Hit Cancel, file doesn't open in calc, and wonder WTF? At this point, i
could still open the file using the open with via the context menu
(right-click), as it suggests, or open the file from within the
application that you'd expect to use to work with that file. But,
technically, the file association is still broke, and this is b.s. BTW -
this is not limited to spreadsheets: it's just about any openoffice
document type.
</buginfo>

<fixinfo>Once i found out what was going on, the fix was relatively
simple, albeit annoying. As root:
1) edit the file /usr/share/mime/packages/x-java-archive.xml. Go to line
35 and add the missing "<" to the beginning of the match tag on that
line (grrrr). Save it.
2) execute the following at a shell prompt:
update-mime-database /usr/share/mime. This appears to not have broken
anything, and seems to work; if someone knows better, feel free to
correct this.
3) start or re-start nautilus by logging into gnome or by logging out
and logging back in, depending on what you were doing. This will cause
nautilus to re-read the mime info.
4) double-click on the file in question, and it will now come up in
openoffice (assuming that's your preferred, installed office application
suite), as you'd expect.
</fixinfo>

<moreinfo>I knew from the outset that this was a mime file association
problem, but wasn't sure where to go from there. Google turned up some
useful links:
http://www.1060.org/blogxter/entry?publicid=E736D3AC9269D49920CA4DC68089EE91
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6510610
The bug report in sun's database states "Closed, fixed", but the
offending xml file was part of the jdk package that i downloaded just a
few days ago, so YMMV.
</moreinfo>

Overall this situation was slightly annoying, but it didn't eat up more
than an hour or two. I even learned a thing or two about fedora's mime
handling subsystem in the process. I tried to keep this brief, really i
did. Oh well.

thoughtfully yours,
- gabriel


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux