title: How can I set the process name for a Java-program?
body: <p>If a Java program is started, it get's in the system process-monitor the name java. Many Java-programs are that way hard to distinguish. So it would be nice, if a way exists, to  set the name, that will be shown in the process-monitor. I'm aware that this may work different on different Operating Systems.</p>
  
  <p>A simple way would be, if the java-interpreter would support a switch to set the name, like this:</p>
  
  <pre><code>java -processname MyProgram -jar MyProgram
  </code></pre>
  
  <p>But I couldn't find such a switch, so it is probably non-existant. An API in Java to set the process-name would be also fine.</p>
  
  <p>So, so you have any suggestions?</p>