Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I run maven project in cmd line

I write maven project and I run it in Eclipse but I want to run maven project in using command line so I write

java -jar -Dapple.awt.UIElement="true" target/myproject-1.0-SNAPSHOT.jar -h

line in cmd but I have this error http://i.stack.imgur.com/c03mN.png.

How can I solve it?

like image 402
kbry Avatar asked Nov 28 '15 22:11

kbry


People also ask

What is the command to run maven?

To build a Maven project via the command line, you use the mvn command from the command line. The command must be executed in the directory which contains the relevant pom file. You pass the build life cycle, phase or goal as parameter to this command.

How do I run a maven command in Windows?

You run Maven by invoking a command-line tool: mvn. cmd from the bin directory of the Maven. To do this conveniently, ${maven. home}\bin must be in your PATH, just like the Java SDK commands.


1 Answers

  1. cd to your project root folder in command line.
  2. mvn compile
  3. mvn exec:java -Dexec.mainClass=com.kub.App

Please check for more informations here.

like image 61
Thu Rein Tin Avatar answered Oct 12 '22 02:10

Thu Rein Tin