title: Multiple entry point (mainclass) for application client jar
body: <p>How do I set up multiple entry points in an application client jar?</p>
  
  <p>I am using Glassfish application server.  I can grab the client using</p>
  
  <pre><code> asadmin get-client-stubs --appname APPLICATION_NAME .
  </code></pre>
  
  <p>I currently can run the default mainclass that I have specified in the MANIFEST.MF.  However, I want to be able to specify another mainclass at runtime.</p>
  
  <p>ie</p>
  
  <pre><code>appclient -client MYJAR.jar -mainclass com.mystuff.Main1
  and
  appclient -client MYJAR.jar -mainclass com.mystuff.Main2
  </code></pre>
  
  <p>Both Main1 and Main2 have "public static void main" entry points.</p>
  
  <p>If I specify a mainclass that is not in MANIFEST.MF, I get the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: Could not locate an embedded app client matching the main class name
  </code></pre>
  
  <p>Do I need to make any changes to have the appclient reference other mainclasses?  </p>