0% found this document useful (0 votes)
31 views

3 Jre, JDK and JVM and Structure of Java Program

Uploaded by

SATYA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

3 Jre, JDK and JVM and Structure of Java Program

Uploaded by

SATYA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

A.B.N &P.R.

R COLLEGE OF
SCIENCE,KOVVUR

SUBJECT: OBJECT ORIENTED


PROGRAMMING THROUGH JAVA

CLASS :IIB.SC(M.P.CS,M.S.CS,M.C.CS)

LECTURE : DELIVERED BY M.MURTHY


JDK ,JRE &JVM:-
Java Software is mainly divide into two parts i.e. JDK & JRE.

JDK:-
JDK is an acronym for Java Development Kit. The Java Development Kit
(JDK) is a software development environment which is used to develop
,compile and execute Java applications It contains JRE + development tools.
Developer needs JDK for developing and executing java applications. When
you download JDK, JRE is also downloaded with it.
JDK= JRE+DEVELOPMENT TOOLS
Development Tools:-
These tools are the foundation of the JDK. They are the tools you use to create and
build applications.
1. Javac(java compiler)------Compiling java program and generate
Bytecode.
2. Java(Interpreter)---------Executing java program.
3. Javadoc-----Document generator and it creates html files format from
source code.
4. Jdb(java debugger)----- java debugger used for error rectification.
5. Javap(java disassembler)----- This tool is used for convert bytecode
into source code(without implementation)

6. appletviewer--- This tool is used for executing applets.


7. javah – the C header and stub generator, used to write native methods
JRE:-
JRE (Java Runtime Environment) is a software package that contains both java
libraries(API) Java Virtual Machine (JVM), and libraries(API) that are required to
run Java applications.
It is only responsible for running java applications.Clients require JRE for running
their java applications.

JRE=JVM+API
JVM:-
 JVM (Java Virtual Machine) is an abstract machine that enables your computer
to run a Java program.
 When you run the Java program, Java compiler first compiles your Java code to
bytecode. Then, the JVM translates bytecode into native machine code (set of
instructions that a computer's CPU executes directly).
Java Program Structure:
 A Java program may contain many classes of which only one class
defines a main method.
 Classes contain data members and methods that operate on the data
members of the class.
 Methods may contain data type declarations and executable
statements. To write a Java program, we first define classes and then
put them together.
 A Java program may contain one or more sections as shown below:
Documentation Section Suggested
Package Statement Optional
Import Statements Optional
Interface Statements Optional
Class Definitions Optional
main Method Class Essential
{
Main Method Definition
}
Documentation Section:
The documentation section has a set of comment lines giving the name of the program,
the author and other details. Java uses a new style of comment.
For Single line comment use // and multiple line comments /*----------
-----------multiple lines.
*/
Package Statement:
The first statement allowed in a Java file is a package statement. This statement
declares a package name and informs the compiler that the classes defined here belong
to this package.
The package statement is optional.
Example: package student;
Import Statements:
The next thing after a package statement is import statements. This is similar to
the include statement in C. This statement tells the interpreter to load the test class
which is in the package student.
Using import statements, we can have access to classes that are part of other named
packages.
Example: import student.Test
Interface Statements:
An interface is like a class but includes a group of method declarations. This is an
optional section. Used only to implement the multiple inheritance features in the
program.
Class Definitions:
A Java program may contain multiple class definitions. Classes are the primary and
essential elements of a Java program. The number of classes used depends on
problem.
Main Method Class:
Java requires a main method as its starting point. This class is the essential part of a
Java program. A simple Java program may contain only this part. The main method
creates objects of various classes and communication between them. At the end of
main, the program gets terminated.
How to install jdk Software:-
We can download latest version jdk-14 download from internet and for
Compiling and executing java programs we must set the path and class
path. We can set the path and class path temporarily and permanently.
We use environment variables of “OS” for setting path and class path.

You might also like