JDK, Jre, JVM
JDK, Jre, JVM
a. JVM
JVM (Java Virtual Machine)is a Java byte code processing engine that converts Java byte
code into machine language, which is then executed by the machine (computer).
When a Java program is created, a file with .java extension is built. This file may contain
several attributes that include but not limited to Classes, methods, objects, and so on. This
.java file is then compiled using a Java Compiler, which generates a .class file (also called
Java Byte Code). JVM then reads this .class file, understands its code, interprets the code into
machine language, and executes the file.
b. JDK
The Java Development Kit (JDK) is a software development environment used for
developing Java applications and applets. It includes the Java Runtime Environment (JRE),
an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator
(javadoc) and other tools needed in Java development.
c. JRE
2. Briefly explain the process of installing and configuring JDK for Windows.
i. Download the JDK. Select the appropriate JDK version. (The Java Standard Edition
JDK is more appropriate which offers all three components: Development Tools,
Source Code and Public JRE).
ii. When running the JDK installer, you may install one or all of the three components
mentioned above. Doing this means that the JDK and JRE will be installed in the
different locations in the operating system. On Windows, that’s C:\Program
Files\Java.
iii. Next is to set JAVA_HOME as environment variable. Go to settings and select the
Advanced tab.
iv. In System Properties window, click Environment Variable. Under System Variables
click the ‘New’ button and enter JAVA_HOME as Variable name and the path to the
Java JDK directory under Variable value.
v. In Environmental Variables window under System Variables, select Path. Click on
Edit then in Edit Environment Variable window click New. Type in %JAVA_HOME
%\bin or copy the directory in step 4.
vi. Move the path up and test using command prompt:
e.g. C:\users\admin>echo %JAVA_HOME%