Friday, August 16, 2013

Launching Myrtle's .jar File On Linux/Unix Systems

Windows users are lucky since the Myrtle .exe file will launch Myrtle from a desktop or a flash drive with no problems.  However, if you happen to be one of those individuals running a Linux/Unix-based OS like Ubuntu, RedHat, Fedora, CentOS, etc. you may have had some difficulty.  You may already know that you can launch the Myrtle spreadsheet executable jar file from a terminal (i.e. xterm) or shell using a command like:
java -jar Myrtle-1.8.11.jar
However, you may have encountered difficulty running Myrtle from within a graphical file browser like Nautilus. This is useful if you want to quickly run Myrtle off of a USB flash drive for example and don't want to bother opening an xterm.  Unfortunately, the default Nautilus behavior is to treat a .jar file as a file archive and it will open and start browsing its contents for you...  Often not what you want to see.

For those on Linux/Unix running a Gnome-based desktop, try the following trick.  Copy the following file to your  ~/.local/share/applications folder where '~' represents your home directory path.

Save the following in a text file named execjar.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=java -jar %f
#You may need to modify icon tag
#to suit your system.
Icon=java-1.7.0
Name=execjar
Comment=Run an executable jar file
From Nautilus you will now be able to "right-click" on the jar file (e.g. Myrtle-1.8.11.jar) that you want to run and then select Open With-->Other Application...  Select execjar from the list and Myrtle will launch. That's it!

Using the above method you are in fact able to launch any executable jar file when needed, but still be able to browse .jar file contents according to the default behavior of Nautilus when wanted.


No comments:

Post a Comment