title: How to execute a java main class from the command line
body: <p>My class:</p>
  
  <pre><code>package com.your.company.cli;
  
  import com.github.domain.cli.Cli;
  import com.your.company.utils.MySuperClass;
  
  public class Hello {
      public static void main(String[] args) throws TechnicalException {
          new Cli().runcli(MySuperClass.class, args);
      }
  }
  </code></pre>
  
  <p>On my Eclipse is OK:</p>
  
  <p><a href="https://i.stack.imgur.com/GRmZw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GRmZw.png" alt="enter image description here"></a></p>
  
  <p>I need run my class by a command line. (after compile by Maven (mvn clean install))</p>
  
  <pre><code>java -cp .... ???? com.your.company.cli.Hello ... ???
  </code></pre>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I try <code>java -jar myproject.jar</code></p>
  
  <p>aucun attribut manifest principal dans myproject.jar </p>
  
  <p>I try <code>java -cp myproject.jar com.your.company.cli.Hello</code></p>
  
  <p>impossible de trouver la classe principale com.your.company.cli.Hello</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I try add <code>maven-jar-plugin</code> but my result is a Maven jar (not a fat jar). I looking for a solution with commande line without jar file please (<strong>juste the same behavior as on Eclipse</strong>).</p>