What is Java?
In simple words, Java is a Programming Language and at the same time, it’s also a Runtime Environment.
As a Programming Language, Java provides us syntax, data type, control structures, object-oriented programming rules, APIs, etc.
As a Runtime Environment, Java provides a base or required infrastructure to execute Java programs on any device, be it Windows, Linux, Mac OS or any Electronic device etc.,
Originally developed by James Gosling and Team at Sun Microsystems and released in 1995, later acquired by Oracle Corporation in 2009.
What are JRE and JDK?
JRE and JDK are software bundles that you can download from oracle.com and install on your computer.
Java Runtime Environment
Imagine, you want to play a game that’s developed in Java. To run that game, you would need to install Java Runtime Environment (JRE) software on your machine.
JRE comprises Java Virtual Machine (JVM) which is responsible to run the Java application.
Without JVM, your machine can’t execute a Java program. Java program is a foreign language to your machine, it needs some interpreter to make it understand what exactly has to be done. JVM is that interpreter to your machine.
Java Development Kit
JDK is for programmers, those who want to create Java applications.
Java Development Kit is a software bundle that provides all the resources, including JVM, to a programmer to make Java applications.
Creating and Running Java Application
- JDK provides javac compiler, which compiles the Java source code to byte code.
- JVM interprets the byte code and executes the program