Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I open .jar files without using terminal in manually installed java? . I tried open with dialog but java is not there .so How do I manually create it?


I want some thing like this

enter image description here

share|improve this question
up vote 4 down vote accepted

Install Ubuntu Tweak.

Go to the 'admins' section, open the File Type Manager, Select 'All' file types, find and select Java Archives in the long list, choose edit, choose the Add button, click on the 'custom command' twisty at the bottom and type the custom command you need it to use to open the file the way you desire.

Here's a picture I did for another question

Here's a picture I did for another question

share|improve this answer

What are you trying to do? To open JAR as archive or to launch the application packed in JAR? Personally, I used to have a problem because Dolphin (KDE's default file manager) launched archiver on every JAR file, and the archiver opened JAR as a usual ZIP.

You can use a script like this and set it as default application for all .jar files. It will select what to do — to open archive or to launch Java application — depending on file's extension:


basename=`basename "$1"`
extension=`echo "$basename" | awk -F . '{print $NF}'`

if [ "$extension" = "jar" ]
    java -jar "$1" # open JAR files with Java
    ark "$1" # open ZIP archives with your archiver (mine is Ark)
share|improve this answer

First you need to create a .desktop file referencing your manually installed java. So, create a .desktop file at ~/.local/share/applications (for example: myjava.desktop) with the following content:

[Desktop Entry]
Name=My Java environment
Exec=cautious-launcher %f /path/to/java -jar

cautious-launcher is just a program that warns the user if the file it is trying to execute has not execution permissions. You should also replace the name and path for your manually installed java.

After this you should have a new entry in the options "Other applications" separator (in this screenshot it already appears in "Recommended applications" because i already used it to open a .jar):

enter image description here

If the entry does not appear try executing update-desktop-database in a terminal.

share|improve this answer

right-click on it, go to "permissions" tab and check "allow executing file as program"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.