title: Executing a jar file in Linux
body: <p>I have created an executable Java .jar file.  That is to say, I <a href="https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute/9689877#9689877">properly packaged a java program inside a .jar file, including a META-INF/MANIFEST file</a>.</p>
  
  <p>(Incidentally, on most Windows machines with Java installed, .jar files are registered to run as something like <code>javaw.exe -jar %1</code>, so you can just double click jars that have been prepared in that way.)</p>
  
  <p>I just copied the same file into Linux and tried to do the same thing.</p>
  
  <p>But, when I click on that file it is just opening the jar as a zip file, rather than invoking java.</p>
  
  <p>How can I configure my Linux system so that the program inside the jar executes when I double click on the jar file?  That is, how can I make my system invoke something like <code>java -jar test.jar</code> when I double click test.jar?</p>