• \[SOLVED\] jar files with double click


    HI! I usually open .jar file with:

    java -jar ilename.jar
    

    but I find it so boring.
    I would like to open .jar files just with double click as for the other files.
    How can I set up my system to do that?

    I tried to look at the menu “open with” but I cannot find any voice about java.

    Thank you.

  • HI! I usually open .jar file with:

    java -jar ilename.jar
    

    but I find it so boring.
    I would like to open .jar files just with double click as for the other files.
    How can I set up my system to do that?

    I tried to look at the menu “open with” but I cannot find any voice about java.

    Thank you.

  • on ubuntu/debian ive been able to do this but never been able to on arch. not sure why.

  • Interesting, seems there is no desktop file with the openjdk package.

    This is how I solved in Gnome -

    1 - create file /usr/share/applications/java.desktop

    In it, paste the below. It may not be perfect, I just wrote this as I went -

    [Desktop Entry]
    Name=OpenJDK
    Comment=Java Application Launcher
    Exec=/usr/bin/java -jar %f
    Icon=java
    Terminal=false
    Type=Application
    NoDisplay=true
    Categories=Utility
    MimeType=application/x-java-archive;

    2 - In Files/Nautilus, right click a jar and click properties. On the ‘open with’ tab, click Reset at the bottom - I had to do this to get OpenJDK to then show up. Then select OpenJDK, and click Set as Default.

  • i might try that out axaxs im in openbox hopefully it works the same. i dont really mind running in the terminal because you can just press up on the keyboard and get recent commands. so not like i have to type it out every time.

  • If this does not help, maybe create just a “start.sh” with the code in it and put it on desktop - like I did for the Minecraft launcher.

  • @“axaxs”:1678kuca said:

    Interesting, seems there is no desktop file with the openjdk package.

    This is how I solved in Gnome -

    1 - create file /usr/share/applications/java.desktop

    In it, paste the below. It may not be perfect, I just wrote this as I went -

    [Desktop Entry]
    Name=OpenJDK
    Comment=Java Application Launcher
    Exec=/usr/bin/java -jar %f
    Icon=java
    Terminal=false
    Type=Application
    NoDisplay=true
    Categories=Utility
    MimeType=application/x-java-archive;

    2 - In Files/Nautilus, right click a jar and click properties. On the ‘open with’ tab, click Reset at the bottom - I had to do this to get OpenJDK to then show up. Then select OpenJDK, and click Set as Default.[/quote:1678kuca]

    Thank you very much. It does work!!!

Posts 7Views 1846
Log in to reply