0% found this document useful (0 votes)
19 views38 pages

Lecture 2

This document outlines the second lecture on Core Java, covering the history of Java, its editions (JSE, JEE, JME), and the differences between JDK, JRE, and JVM. It includes instructions for downloading and installing JDK, as well as information on Java's release timeline and support policies. The lecture concludes with a preview of the next session's agenda, which focuses on writing Java code.

Uploaded by

mt9825854
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views38 pages

Lecture 2

This document outlines the second lecture on Core Java, covering the history of Java, its editions (JSE, JEE, JME), and the differences between JDK, JRE, and JVM. It includes instructions for downloading and installing JDK, as well as information on Java's release timeline and support policies. The lecture concludes with a preview of the next session's agenda, which focuses on writing Java code.

Uploaded by

mt9825854
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

JAVA SE

(CORE JAVA)
LECTURE 2
Today’s Agenda

Moving Ahead with JAVA

• History Of Java

• Editions Of Java

• Difference Between JDK,JRE and JVM

• Downloading JDK

• Installing JDK

• Verifying The Installation


History Of Java

 Developed By: James Gosling

 Original Company Name: Sun Microsystems

 Current Company: Oracle Corp

 Original Name: Oak but due to copyright issues


, changed to Java James
 First release: 23rd January 1996 Gosling
 First version: JDK(Java Development kit) 1.0

 Latest version : JDK(22.0) released on 19 Mar 2024


Editions/Flavours Of Java

• When Java was originally released in 1996, it was


just Java and no such thing as “editions” was there.

• But as use of Java increased , then in 1999 , SUN


categorized it into 3 editions called J2SE,J2EE and
J2ME .

• Later on in 2006 they changed the naming and


called them as JSE,JEE and JME.

• These editions were named based on the kind of


application which can be developed by learning
that edition.
Java Editions
JSE(Java Standard Edition)

• This is the most basic version of Java and it


provides us core concepts of Java language
like the data types , operators, arrays,
methods , OOP , GUI (Graphical User
Interface ) etc.

• Since it teaches us core concepts of Java


that is why many people call it CORE JAVA ,
although SUN never gave this name.

• Used for developing desktop applications like


calculators, media player, IDE etc
JEE(Jakarta Enterprise Edition)

• Originally called Java Enterprise Edition but from


2017 it was renamed to Jakarta Enterprise Edition

• JEE is built on top of the Java SE platform and is a


collection of libraries used for building "enterprise
applications" (usually web applications).

• In simple terms we can say JEE is used for


developing applications which run on servers.

• Some popular applications developed using JEE are


amazon.in, alibaba.com, linkedin.com, myvi.in,
support.apple.com etc
JME(Java Micro Edition)

• Java ME is the slimmer version of Java targeted


towards small devices such as mobile phones.

• Generally people tend to think of the


micro edition as the mobile edition, while in
reality, the micro edition is used not just for mobile
phones, but for all kinds of devices, such as
television sets, printers, smartcards and more.

• But as smartphone technology arrived the use of


JME has reduced as Android has superseded it.
JDK v/s JRE v/s JVM

• Understanding the difference between JDK,JRE


and JVM is very very important in Java for
interviews

• These terms stand for:

• JDK: Java Development kit

• JRE: Java Runtime Environment

• JVM: Java Virtual Machine


What Is JVM ?

• JVM is a software that can be used to run Java


programs.

• In simple terms it is the code execution


component of java

• It is designed for each platform(OS+CPU)


supported by Java and this means that every
platform will have a different version of
JVM
QUIZ

 What does the JVM(Java Virtual Machine) do?

 Compiles the Java Source Code

 Generates bytecode

 Converts bytecode to underlying machine’s instruction set.

 Checks for error


QUIZ

 The JVM for every platform is different

 True

 False
QUIZ

 The bytecode generated by Java compiler for the same code for
every platform is different

 True

 False
QUIZ

• Why JVM is called a virtual machine ?

JVM is called virtual machine because it is a software layer


but it
behaves as if it is a complete machine(platform).

That is all the tasks which are done by a machine while


running a
program in other languages like C , are actually done by JVM in
Java .

For example:
Starting The Execution By Calling main( )
Allocating Memory For The Program
Cleaning Up Memory cleanup etc
What JVM Contains?

• JVM contains following important components

• Interpreter

• Garbage Collector
QUIZ

• Are java compiler and interpreter same?

No , not at all.

The Java compiler converts source code to bytecode


and is not a
part of JVM , rather it comes with JDK.

The interpreter lives inside the JVM and converts


bytecode to
Machine understandable form
What Is JRE ?

• JRE is an acronym for Java Runtime Environment

• It contains a JVM along with java


classes/packages and set of runtime libraries.

• So the JVM , while running a java program uses


the classes and other libraries supplied by JRE.

• If we do not want to write a java program , and


we just want to run it then we only need a JRE
What Is JDK ?

• JDK stands for Java Development Kit and is a


bundle of software that we can use to develop
Java based applications.

• It includes the JRE, set of library classes, Java


compiler, jar and additional tools needed
while developing a Java application.
JDK,JRE and JVM
QUIZ

• Can I compile a java application if I have a


JRE ?

• Yes

• No
Correct Answer: No

• JRE can only be used to run a Java


application . It doesn’t contain the javac
tool which is used for compilation
QUIZ

• Which component is used to compile,


debug and execute java program?
 A) JVM
 B) JDK
 C) JIT
 D) JRE

Correct Answer: B
QUIZ

• Which component is used to convert bytecode


to machine specific code ?
 A) JVM
 B) JDK
 C) JIT
 D) JRE

Correct Answer: A
QUIZ

• Which component is used to provide a platform


to run a java program ?
 A) JVM
 B) JDK
 C) JIT
 D) JRE

Correct Answer: D
Downloading JDK

 STEP 1: Go to
 https://www.oracle.com/java/technologies/downloads/
Downloading JDK

STEP 2: Click on the tab of your OS and click on


x-64 installer
Downloading JDK
STEP 3: You will be asked to login. So login to
your Oracle account
Installing JDK

 The download will begin .

 When the download completes, you will get an exe


file called jdk-17.0.02_windows-x64_bin.exe

 Now, right click on this exe file and "Run as


Administrator".

 An installer window will pop up.


Installing JDK
Installing JDK
Installing JDK

 If everything goes perfectly you will receive a


message saying that installation is successful.
Verifying Installation

 Go to the specified path, where you install your Java.

 By default Java gets installed in C:\Program Files folder

 There you will see a Java folder

 Inside the Java folder you will see jdk-17.0.2 folder


Verifying Installation

Go to start type cmd and open it by clicking on it


and type the following command highlighted in red:
LTS And STS

• The last 4 years have seen some rapid


changes in the way new versions of the Java
Development Kit is deployed and
maintained.

• Traditionally, new Java versions were always


released in a 2 to 4 year life cycle.

• Every 2 to 4 years, a new JDK would be


released, containing some new features .
LTS And STS

 JDK Release Tmeline

 – JDK 6: launched in Dec,2006

 – JDK 7: launched in July , 2011

 – JDK 8: launched in Mar,2014

 – JDK 9: launched in Sep, 2017


LTS And STS

• But from Java 10 ,which was released in March 2018,


Oracle changed the new release policy and
decided to launch a new version of Java every 6
months.

• Now , it became very difficult for Software


Developers to keep their applications or several
hundred (thousand?) servers up to date with the
newest Java release.

• That is why , the concept of an LTS was


established.
LTS And STS

• A Java LTS (long-term support) release is a version


of Java that will remain the industry standard for
several years.

• To give an example of this, Java 8 was released in


2014, it will continue to receive updates until
2022, and extended support will end by 2030.

• This gives plenty of time to application


developers to update their applications to take
full advantage of Java 8 features.

https://www.oracle.com/java/technologies/java-se-
support-roadmap.html
LTS And STS

• The next LTS version is Java 11, which was released


in 2018 and will continue to receive updates until
2026, with a strong possibility of date extension

• The next 4 releases of Java, after Java 11, which


are Java 12 , Java 13 , Java 14 & Java 15 are all
STS ( Short Term Support)

• JDK 17, which has released in September 2021,


was the next LTS release and latest LTS release is
JDK 21 released in September 2023 and is
expected to be supported till September2026 with a
strong possibility of date extension
End Of Lecture 2

For any queries mail us @: [email protected]


Call us @ : 0755-4271659, 9826686245

Agenda for Third Lecture:


1. Different Ways Of Writing A Java Code
2. Writing First Java Code Using Notepad
3. Different Elements In The Code
4. Explanation Of Each Element

You might also like