Check out example codes for "how to run a java file in terminal". It will help you in understanding the concepts better.

Code Example 1


Code Example 2

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

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

Learn ReactJs, React Native from