bash is the terminal , where you can compile or run the programs,.
to compile you write in bash : javac “nameOfTheProgram”.java
to run a program : java “nameOfTheProgramm”
compiling is just a process where the terminal will take all the programing you did in java and sort of translate it to binary so the computer will follow the rules and indications you wrote. that’s why compiling only catches “grammar” ans syntax errors.