How To Run The Java Program In Cmd Code Example

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

// Assuming that you have packaged jar
java -jar target/myJavaProject.jar 
Snippet 2
  javac MyFisrtProgam.java // enter to compile 
  java MyfirstProgram // run program