What is the difference between JDK and JRE?
What are their roles and when should I use one or the other?
JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.
JRE is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.
JDK is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.
So, Basically JVM < JRE < JDK as per @Jaimin Patel said.