jack_the_beast
jack_the_beast

Reputation: 1971

export with eclipse and run in cmd

I'm trying to export a maven application with eclipse and then run it from the cmd.

I tried to export it as a excutable jar but when I try to run it, cmd says it can't find the main class

how can I solve this problem?

thanks

Upvotes: 0

Views: 53

Answers (1)

Yann
Yann

Reputation: 144

did you specify the main class in the jar manifest ?

in maven you set it like this (if I'm not wrong)

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
      <archive>
        <manifest>
          <mainClass>mypackage.myMainClass</mainClass>
        </manifest>
      </archive>
    </configuration>
</plugin>

Hope this will help,
Yann

Upvotes: 1

Related Questions