title: Is there a way to know if a Java program was started from the command line or from a jar file?
body: <p>I want to either display a message in the console or a pop up, so in case a parameter is not specified, I want to know to which should I display</p>
  
  <p>Something like:</p>
  
  <pre><code>if( !file.exists() ) {
      if( fromCommandLine()){
          System.out.println("File doesn't exists");
      }else if ( fromDoubleClickOnJar() ) {
          JOptionPane.showMessage(null, "File doesn't exists");
      }
   }
  </code></pre>