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 // enter to compile 
  java MyfirstProgram // run program 

Copyright © Code Fetcher 2020




Leave a comment

Your email address will not be published. Required fields are marked *