This bash script permits to compile Java files easily and automatically launch
Remplace fileName with what you what !
wget https://javacompile.thomaslacaze.fr/fileName.sh && chmod +x fileName.sh && fileName.sh fileToCompile.java
OR
wget https://raw.githubusercontent.com/LacazeThomas/Compile-JAVA-Easily/master/javaCompile.sh && chmod +x javaCompile.sh && ./javaCompile.sh fileToCompile.java