compile and run java program in command prompt code example
Example 1: compile java
// compile
> javac myCode.java
// run
> java myCode
Example 2: how to run a java file in terminal
javac FirstJavaProgram.java
// compile
> javac myCode.java
// run
> java myCode
javac FirstJavaProgram.java