title: How to get default application name in cli?
body: <p>I want to create a framework that shows the application name on statup. Targeting command line interface applications.</p>
  
  <p>Question: how can I get such an application name in a generic way?</p>
  
  <p>Eg spring offers a property, but which is not set by default:</p>
  
  <pre><code>@Value("${spring.application.name}")
  private String appname;
  </code></pre>
  
  <p>And I don't want to set that property explicit. Looking for some kind of "default application name".</p>
  
  <p>In a Java EE container there is also the following option:</p>
  
  <pre><code>String myApplicationName = (String) initialContext.lookup("java:app/AppName");  
  </code></pre>
  
  <p>But how about <code>CLI</code> apps? How can I get some kind of generic application name?</p>