title: Prevent launching multiple instances of a java application by binding a ServerSocket
body: <p>I'm trying to prevent the launching multiple instances of a java application by binding a <code>ServerSocket</code>. </p>
  
  <p>Currently I'm executing it in my main as seen below:</p>
  
  <pre><code>public static void main(String[] args) {
  
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {
  
              try {
                  ServerSocket serverSocket = new ServerSocket(65535, 10);
  
                  showFrame();
              } catch (IOException e1) {
                  e1.printStackTrace();
              }
          }
      });
  }
  </code></pre>
  
  <p>It isn't working as in Eclipse I can still open two instances of the application.</p>