title: Spring Boot: Renaming the Main class
body: <p>I'm new to Spring and Spring Boot, but I'm using it as a template. </p>
  
  <p>The Main.java file contains in part the following:</p>
  
  <pre><code>package com.example;
  
  @Controller
  @SpringBootApplication
  public class Main {
  
  }
  </code></pre>
  
  <p>Unfortunately I need to import another class that is called Main, and use it in this class. The other class is in a Jar and I don't really want to recompile it, so I was thinking the best way would be to rename this Main.</p>
  
  <p>However when I do that (renaming it to JavaGettingStarted), the Maven plugin for Spring Boot will fail: </p>
  
  <pre><code>[ERROR] Failed to execute goal
  org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage
  (default) on project java-getting-started: Execution default of goal
  org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage
  failed: Unable to find a single main class from the following
  candidates [com.example.JavaGettingStarted, com.example.Main] -&gt; [Help
  1]
  </code></pre>
  
  <p>Is Main some sort of default? Can I change it?</p>