title: How to set Run Configuration and Debug Configuration in Eclipse to choose the class that has the main method as the start-up class?
body: <p>I am using Eclipse for Java EE, Mars 2.</p>
  
  <p>I have two classes in my Java (Swing application) project:</p>
  
  <ol>
  <li>Program.java (has the main method)</li>
  <li>Foo.java</li>
  </ol>
  
  <p>If I right-click the editor while <code>Program.java</code> is open, the context-menu presents the commands <strong>Java Application</strong> and <strong>Run Configurations</strong> under the <strong>Run As</strong> menu.</p>
  
  <p>The same happens if I right-click the editor surface while <code>Program.java</code> is open and choose <strong>Debug As</strong> from the context-menu. I see the two sub-menu items namely, <strong>Java Application</strong> and <strong>Debug Configurations</strong>.</p>
  
  <p>However, when I have <code>Foo.java</code> open, right-clicking the editor surface presents only one sub-menu item named <strong>Run Configurations</strong> or <strong>Debug Configurations</strong> upon choosing <strong>Run As</strong> or <strong>Debug As</strong> respectively.</p>
  
  <p>So, every time I want to run my project and I accidentally right-click the editor surface area while <code>Foo.java</code> is open, I then have to go to the editor tab that has <code>Program.java</code> open and right-click again and choose the right menu item.</p>
  
  <p>I am suspecting there is a way in the <strong>Run Configurations</strong> and <strong>Debug Configurations</strong> dialog boxes to tell Eclipse to choose the <code>Program.java</code> class to run as the start-up class since it has the <code>main</code> method.</p>
  
  <p>How do I do that?</p>