PDA

View Full Version : [kubuntu] .jar being detected as a .zip



klkblake
May 11th, 2008, 02:20 AM
I have a jar file I want to be able to execute by clicking on. I've set it up correctly, and it was working yesterday, but now kubuntu thinks that it is a zip archive. Im using kubuntu 8.04 with kde4.0.

Xiong Chiamiov
May 11th, 2008, 10:20 AM
That's because .jar files really are just compressed folders. I'm not sure how to change it so that you can launch it in the GUI by double-clicking, but you should be able to do something like ./[name of file] in the terminal.

arizonagroovejet
May 11th, 2008, 07:31 PM
Assuming you're using KDE 3 then try K-Menu > System Settings > Default Applications > File Association. Type 'jar' in to the search box and then change the Application Preference Order. On my system Ark is at the top of the list and it sounds like that's the case on your system too.

klkblake
May 12th, 2008, 08:04 AM
The java vm is the first option in the file association for .jar file. If I go to the properties page for a .jar file, it says that it is a zip archive.

Sarah L
May 14th, 2008, 08:12 PM
You should be able to run .jar files by going into the terminal and running:


java -jar <path of jar file>


It's a pain in the rear, but you can create a launcher file to run this for you.

Defrector
February 11th, 2010, 04:21 AM
I am resurrecting this thread because I am finding it in kubuntu 9.10. In file associations, .jar is set up correctly as a java archive but still shows up as a .zip file and is treated like a zip file in file browsers. All application entries for .zip files in the file associations do not show *.jar in their file types.

...so where could KDE be getting the idea of labeling a .jar as a .zip archive?

UPDATE: Found a bug report.
https://bugs.launchpad.net/ubuntu/+source/krusader/+bug/309778

Defrector
February 11th, 2010, 05:19 AM
Found the following workaround:


sudo rm /usr/share/mime/packages/sun-java*-jre.xml
sudo update-mime-database /usr/share/mime/

...log out of KDE.
...log back in.

mcduck
February 11th, 2010, 02:32 PM
...so where could KDE be getting the idea of labeling a .jar as a .zip archive?

Because it really is a .zip archive. Same applies to OpenOffice documents, firefox .xpi extension packages and many other files. They are just a bunch of files zipped together, with a different file name extension. :)

Defrector
February 11th, 2010, 09:08 PM
The issue is not the philosophy as to what a .jar file is.

The issue involves KDE mislabeling a MIME type due to a bad xml file and permanently disabling the ability to call 'java -jar' when clicking a .jar file.