how to run a java program in terminal linux 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