Introduction
Java is a popular and powerful programming language, created in 1995.
It is owned by Oracle, and more than 3 billion devices run Java.
It is used for:
- Mobile applications (specially Android apps)
- Desktop applications
- Web applications
- Web servers and application servers
- Games
- Database connection
Java Architecture
The JVM, JRE, and JDK are all components of Java Architecture. It combines the interpretation and compilation processes. It enumerates all of the steps involved in writing a Java program. The Java Architecture describes each step in the compilation and execution of a program. The below-mentioned points and diagram will simply illustrate Java architecture:
- There is a compilation and interpretation process in Java.
- After the JAVA code is written, the JAVA compiler comes into the picture that converts this code into byte code that can be understood by the machine.
- After the creation of bytecode JAVA virtual machine(JVM) converts it to the machine code, i.e. (.class file)
- And finally, the machine runs that machine code.
Components of Java Architecture
Java architecture consists of three main components and those are JRE(Java Runtime Environment), JDK(Java Development Kit), and JVM(Java Virtual Machine).
Java Runtime Environment(JRE)
Java programs can run in a runtime environment created by the JRE software. The Java Runtime Environment (JRE) is a disk-based system that mixes Java code with necessary libraries. Finally, the Java Virtual Machine (JVM) begins to run the Java code. The Java Runtime Environment (JRE) contains all of the libraries and software required to run Java programs. Although JRE is included in the JDK, it is also available for download individually.
Java Development Kit(JDK)
It’s a Java application and applet development environment. JRE, a compiler, an interpreter or loader, and a number of development tools are all included in the Java Development Kit. Now we will walk through these development tools which come along with JDK:
- Java(loader/executor): responsible for launching Java applications
- javac(compiler): It is responsible for compilation of java programs
- Javadoc: provides support for generation of API documentation
- Jar: responsible for creating and managing all JAR files.
Java Virtual Machine(JVM)
WORA is Java’s most important feature. Write Once, Run Anywhere is an acronym for WORA. We may develop our code once and utilize it anywhere and on any operating system, according to the feature. Due to the Java Virtual Machine, our Java software can execute on any platform. It is a Java platform component that provides us with a platform in which we can run Java programs. The basic job of the JVM is to transform byte code into machine code. On the whole, JVM performs these functions – loads and verifies the code and then executes the code, and enables the runtime environment.
java code
public class Home
{
public static void main(String [] args)
{
System.out.println("Hello Wolrd!!!");
}
}
Output:
C:\Users\acer\Desktop\java>javac Home.java
C:\Users\acer\Desktop\java>java Home
Hello Wolrd!!!

Top comments (0)