What is the difference between JDK and JRE?
What are their roles and when should I use one or the other?
If you want to run Java programs, but not develop them, download the Java Run-time Environment, or JRE. If you want to develop them, download the Java Development kit, or JDK
Let's called JDK is a kit, which include what are those things need to developed and run java applications.
JDK is given as development environment for building applications, component s and applets.
It contains everything you need to run Java applications in compiled form. You don't need any libraries and other stuffs. All things you need are compiled.
JRE is can not used for development, only used for run the applications.