how to run java file in 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
javac HelloWorld.java
java HelloWorld
javac FirstJavaProgram.java