title: How does Java runtime find my main class?
body: <p>I am learning Spring Boot. I made a simple Spring Boot project that can output a hello world string at <a href="http://localhost:8080/welcome" rel="nofollow noreferrer">http://localhost:8080/welcome</a></p>
  
  <p>I use Maven to build my project that would output a jar file.
  To start up my spring boot app, I use the command as below</p>
  
  <pre><code>java -jar my-springboot-app.jar
  </code></pre>
  
  <p>My question is:</p>
  
  <p>How is java smart enough to locate my main class and its main method (e.g. the application launcher)?</p>
  
  <p>I checked the jar file and browsed those BOOT-INF &amp; META-INF and could not find any clues.</p>
  
  <p>Does the spring boot framework (@SpringBootApplication) or maven automatically do the magic for me?</p>