Check out example codes for "java run project from command line". It will help you in understanding the concepts better.

Code Example 1

// Assuming that you have an executable jar
java -jar myJavaProject.jar

// Assuming that you have packaged jar
java -jar target/myJavaProject.jar

Code Example 2

javac MyFisrtProgam.java // enter to compile 
  java MyfirstProgram // run program

Learn ReactJs, React Native from akashmittal.com