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