How to compile java over terminal, command line , Run java file

1. You need to check, java version with this command

$ java -version

 

2. Compile the code

$ javac …… …

 

3. Run The compiled

$ java -jar compiled.jar

 
[crayon-6ad1a536df9d8685234614/]
 

 
[crayon-6ad1a536df9e0973384279/]