After installing the Java 6 RPM on Fedora Core (jdk-1.6.0-fcs), Nautilus prints the following error when you try to open an OpenOffice document:

The filename "Report.sxw" indicates that this file is of type "OpenOffice Writer". 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.

This is because the file /usr/share/mime/packages/x-java-archive.xml that is created by the Java RPM is broken. To fix it, add a "<" in front of the second "match" tag:

--- x-java-archive.xml.orig     2006-12-24 14:47:05.000000000 +0100
+++ x-java-archive.xml  2006-12-25 11:57:03.000000000 +0100
@@ -32,7 +32,7 @@
     <glob pattern="*.jar"/>
     <magic priority="85">
       <match type="string" value="PK\003\004" offset="0">
-       match type="host16" value="0xcafe" offset="40" />
+       <match type="host16" value="0xcafe" offset="40" />
       </match>
     </magic>
   </mime-type>

Then run the following command:

update-mime-database /usr/share/mime

Log out and log in again to restart Nautilus.

Update 12 Jan 2007: This has been filed as ticket 6510610 in Sun's Bug Database.

Update 7 Jul 2007: The bug has been fixed in Java 6 Update 2.

12:25, 25 Dec 2006 by Carsten Clasohm Permalink

Comments

Works for me

Thanks. I'm running RHEL4 and ran across the problem. Added the "<" ran "update-mime-database /usr/share/mime" and did a refresh of Natulis. Works fine.

by Anonymous Visitor, 18 Apr 2007

Thanks

This problerm was driving me nuts, thanks for posting the solution.

by Anonymous Visitor, 02 May 2007

Incredible

This bug is still there!!!  In fedora7!!! I had it six months ago with fedora 6... Anyway, Thanks!!!

by Anonymous Visitor, 18 Jun 2007

Re: Incredible

This is a bug in the Sun Java RPM, which is not part of Fedora.

by Carsten Clasohm, 18 Jun 2007

Thank You

This as been annoying me for a while.

Thanks for the solution!

by Anonymous Visitor, 15 Aug 2007

Thank you

Annoying bug. Thanks.

by Anonymous Visitor, 27 Feb 2008

Add a Comment

Comments are reviewed before they appear on this page.

Title:

Comment:

Text above is