how to run java file in linux terminal code example
Example 1: how to run a java file in terminal
javac FirstJavaProgram.java
Example 2: run java from terminal linux
//To compile, type
javac filename.java
//To run the generated class file, use
java filename