1javac filename.java //(This will compile the program)
2java filename //(This will run the file)
1javac MyFisrtProgam.java // enter to compile
2 java MyfirstProgram // run program
3
1// Assuming that you have an executable jar
2java -jar myJavaProject.jar
3
4// Assuming that you have packaged jar
5java -jar target/myJavaProject.jar