Compiler : Is a translator which is used to convert source code into intermediate language,
Interpreter : It is used to transalate the resultant intermediate code to Machine Code .
Here java use Javac compiler and Java interpreter
Source code is converted into byte code or class file using javac compiler ,
this code is platform independent,when we put this code to other os it will run,
then the bytecode is converted into machine code using java (interpreter) is nothing but JVM(Java Virtual Machine) it contains JRE(Java Runtime Environment) + JIT(Just In Time) Compiler.
Interpreter : It is used to transalate the resultant intermediate code to Machine Code .
Here java use Javac compiler and Java interpreter
Source code is converted into byte code or class file using javac compiler ,
this code is platform independent,when we put this code to other os it will run,
then the bytecode is converted into machine code using java (interpreter) is nothing but JVM(Java Virtual Machine) it contains JRE(Java Runtime Environment) + JIT(Just In Time) Compiler.

