Compiling and running the program

Finally, we will compile and execute our program from the command line. There is nothing new in this one; we will only apply what we have learned in this chapter using the following two commands:

$ mvn package

This compiles the program, packages the result into a JAR file, and finally executes the following command:

$ java -cp target/SortTutorial-1.0.0-SNAPSHOT.jar packt.java11.example.App

This will print the following result on the command line:

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.