old blog,

JDK 6 RPM messed up with zip mimetype

Izhar Firdaus Izhar Firdaus Follow Support Feb 17, 2007 · 1 min read
JDK 6 RPM messed up with zip mimetype
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
I installed JDK 6 RPM from Sun's Java SE download page for my Object Oriented Programming course. After installation, I was annoyed by all of my zipfiles and files that uses zip format to be identified as x-java-archive. This change created an annoying "Warning wrong filetype" when opening files that uses zip format but uses different extension - like ODF files. And when I select those files, their icons also changed to java-archive icons.

Being greatly annoyed, I started hunting down the mime-type definition. First, I tried to find the definition by grepping x-java-archive from the jdk rpm
# rpm -ql jdk|grep x-java-archive|grep -v icons
Bingo!. Found it.

I fired up vi and edited the definition file and commented out the <magic> tag
<!-- <magic priority="85">
<match type="string" value="PK\003\004" offset="0">
match type="host16" value="0xcafe" offset="40" />
</magic> -->

Juz to be sure , I tried to locate other x-java-archive definitions and commented out their <magic> tags

# updatedb 
# locate x-java-archive.xml

After editing them, the mime cache need to be updated for things to take effect immediately.
cd /usr/share/mime/
update-mime-database /usr/share/mime/

Finally, relogin to gnome for applying the changes.

Yeah~!, no longer annoying "Warning wrong filetype" messages when double-clicking ODF files and others that uses zip format.
Written by Izhar Firdaus Follow Support
I'm a system architect, data engineer and developer advocate with passion in Free / Open Source software, entrepreneurship, community building, education and martial art. I take enjoyment in bridging and bringing together different FOSS technologies to help businesses and organizations utilize IT infrastructure to aid and optimize their business and organizational process.

Happy Chinese New Year

Happy chinese new year to all chinese visitors of this blog~~- Izhar Firdaus -

In old blog, Feb 17, 2007

« Previous Post

yum-keep-retry plugin

This is my first try to write something useful using python .. so, please tell me if something not right with this plugin ..Functiona...

In old blog, Feb 20, 2007

Next Post »