What is the difference between JDK and JRE?
What are their roles and when should I use one or the other?
JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.
Java Virtual Machine (JVM) is a run-time system that executes Java bytecode.
JRE is the environment (standard libraries and JVM) required to run Java applications.
The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.