use "javac Main.java" then "java Main" to compile and run the program.