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

Re: KDE, Konqueror, open/view Java jar file



On Tue, Oct 18, 2005 at 09:06:44AM -0400, rs wrote:
} Is it possible to set up Konqueror so it would open (i.e. show the
} content of ) a java jar file the way it does for, say, tar or zip files?
} Currently, when I click on a Jar file, Konqueror opens the "Open with"
} dialog:
} 
} Open 'zip:/home/luser.../lib/junit.jar'?
} Type: Java Archive
} [Save] [Open With] [Cancel]
} 
} I tried specifying "Open it with /usr/bin/unzip" (since jar file is
} basically a Zip archive) but, at best, I was able to extract the whole
} Jar into the current directory, instead of just viewing it.
} 
} Any ideas? Thanks 

This is just an idea, and I can make no guarantee that it will work.
Konqueror (or, more likely, KDE in general) must be using some kind of
extension to MIME type mapping, then mapping MIME types to actions. (At
least, I assume they are using MIME types, since it's standardized, has
been done that way in numerous previous systems (e.g. Netscape), and it
allows anything that talks HTTP to hook right in.) They clearly aren't
using magic numbers, or jar files would be recognized as zip files.

This means that, somewhere, there is a configuration file with that
extension to MIME mapping. They may be using the standard /etc/mime.types
or they may be using something KDE-specific (though I'm not finding
anything promising in /etc/kde3). What you can do is to change the MIME
type that .jar files map to so that it's application/zip instead of
application/java-archive. I suspect that KDE reads this file once at
startup and caches it, so you will probably have to end your KDE session
(i.e. logout) and start a new one after making the change.

It is also possible that the Konqueror preferences or KDE control center
has a UI to altering this mapping, and you could do it there. In that case,
there should be no need to restart your session.

--Greg



Reply to: