title: Executable JAR on Ubuntu (NetBeans)
body: <p>I'm writing a simple Swing application in NetBeans and doing so on an Ubuntu machine for the first time.</p>
  
  <p>As many of you know, NetBeans automatically creates executable JARs for projects that are "set as main".</p>
  
  <p>On Windows, you can double-click an executable JAR and it automatically invokes the JRE and runs the app. In Ubuntu, double-clicking the .jar file causes the file to be opened in the archive manager instead. In order to run my JAR, I either have to right-click it and select "Open with OpenJDK Java 6 Runtime" or launch it from the command line.</p>
  
  <p>From the command line I get no problems whatsoever. <strong>However</strong>, when I try launching it from the right-click menu, I get an error that reads:</p>
  
  <p><em>The file MySwingApp.jar is not marked as executable...</em></p>
  
  <p>So I have 2 questions:</p>
  
  <ol>
  <li>What do I have to do to set it as executable? Is this something I can do inside NB or do I have to use the shell? If I have to set permissions via the shell, doesn't that conflict with NB's policy of auto-generating **executable** JARS? And what command would I use to flip the executable bit anyhow?!?!</li>
  <li>Is this just a Linux hiccup? I want to send this JAR to friend who run Windows and I'd like for them to be able to just double-click it and have the program launch</li>
  </ol>
  
  <p>Thanks for any helpful suggestions!</p>