Saturday, April 18, 2015

Package and java application into Jar file and execute it from command line

Steps:
1- Build Jar artifact myApp.jar
2- Execute the applicatoin jar form command line:
~/java -jar myApp.jar

Execurting Java class from command line

Directory structure:
~\com\company\Main.class

To execute the class Main::main() function:
~\java com.company.Main