Page 0Classification: Restricted
Core Java Training
Introduction to Java
Page 1Classification: Restricted
Agenda
• History of Java – A Programmer’s Perspective
• Salient Features of Java
• Major Java Editions
Page 2Classification: Restricted
Ice Breaking…
• Expectation setting…
• Bird’s eye view of the training…
Page 3Classification: Restricted
Introduction to Java
Page 4Classification: Restricted
European Agricultural Revolution: 1700 onwards
Page 5Classification: Restricted
Industrial Revolution
Page 6Classification: Restricted
Evolution of Computer Science – initially based on mechanical systems
Page 7Classification: Restricted
A point to ponder…
• What led to the evolution of electronic computation systems?
More specifically… When we already had mechanical computing
machines and calculators, what made us base the modern computing
systems on electronics?
Page 8Classification: Restricted
A point to ponder…
• What led to the evolution of electronic computation systems?
More specifically… When we already had mechanical computing
machines and calculators, what made us base the modern computing
systems on electronics?
• Switching speed.
• Wear and tear.
Page 9Classification: Restricted
Building Blocks of a Basic Modern Computer System
• Based on von Neumann architecture
• John von Neumann was a Hungarian computer scientist.
2
Page 10Classification: Restricted
A point to ponder…
• Ok, so the CPU is the brain of the computer system. Then why do I need an
OS?
Page 11Classification: Restricted
A point to ponder…
• Ok, so the CPU is the brain of the computer system. Then why do I need an
OS?
• Communicating with the CPU using its instruction set is cumbersome, it is
difficult. We need an interpreter.
Page 12Classification: Restricted
A point to ponder…
• Ok, an OS is the interface between the user and the CPU. Then why would I
need a programming language?
Page 13Classification: Restricted
A point to ponder…
• Ok, an OS is the interface between the user and the CPU. Then why would I
need a programming language?
• How would you add functionalities to the software that is not already
available in an OS?
Page 14Classification: Restricted
A point to ponder…
• Ok, agreed I would need a programming language. Now, that we already
had other languages like C for Procedural Programming, C++ for Object
Oriented Programming, why did we have to write another language like
Java?
Page 15Classification: Restricted
A point to ponder…
• Ok, agreed I would need a programming language. Now, that we already
had other languages like C for procedural programming, C++ for Object
Oriented Programming, why did we have to write another language like
Java?
• Necessity is the mother of invention. There is a business intent behind this
invention too. But, what is that requirement?
Page 16Classification: Restricted
The Compilation Process for Non-Java Programs (like C & C++)
Source Code
(programming
language
instructions)
Object Code
(binary
instructions)
Programmers write
this.
Computers run this.
Compilers
compile source
code into object
code.
Page 17Classification: Restricted
History of Java
• In the early 1990's, putting intelligence into home appliances was thought
to be the next "hot" technology.
• Examples of intelligent home appliances:
• Coffee pots and lights that can be controlled by a computer's programs.
• Televisions that can be controlled by an interactive television device's
programs.
• Anticipating a strong market for such things, Sun Microsystems in 1991
funded a research project (code named Green) whose goal was to develop
software for intelligent home appliances.
• An intelligent home appliance's intelligence comes from its embedded
processor chips and the software that runs on the processor chips.
• Appliance processor chips change often because engineers continually find
ways to make them smaller, less expensive, and more powerful.
• To handle the frequent turnover of new chips, appliance software must be
extremely portable.
Page 18Classification: Restricted
The Issue of Portability
• A piece of software is portable if it can be used on many different types of
computers.
• Object code is not very portable. As you know, object code is comprised of
binary-format instructions. Those binary-format instructions are intimately
tied to a particular type of computer. If you've got object code that was
created on a type X computer, then the object code can run only on a type
X computer.
• The Java solution to improve portability:
• Java compilers don't compile all the way down to object code. Instead,
they compile down to bytecode, which possesses the best features of
both object code and source code:
• Like object code, bytecode uses a format that works closely with
computer hardware, so it runs fast.
• Like source code, bytecode is generic, so it can be run on any type of
computer.
Page 19Classification: Restricted
The Compilation Process for Java Programs
Java source
code
object code
Java compilers
compile source code
into bytecode.
bytecode
When a Java program is
run, the JVM translates
bytecode to object code.
Page 20Classification: Restricted
Java Virtual Machine
• How can bytecode be run on any type of computer?
• As a Java program’s bytecode runs, the bytecode is translated into object
code by the computer's bytecode interpreter program. The bytecode
interpreter program is known as the Java Virtual Machine, or JVM for short.
The JVM is written specifically for every platform.
Page 21Classification: Restricted
Issue of Portability Solved.. But..
• Originally, Sun planned to use C++ for its home appliance software, but
they soon realized that C++ was less than ideal because it wasn't portable
enough and it relied too heavily on hard-to-maintain things called pointers.
• Thus, rather than write C++ software and fight C++'s inherent deficiencies,
Sun decided to develop a whole new programming language to handle its
home appliance software needs.
• Their new language was originally named Oak (for the tree that was outside
project leader James Gosling's window), but it was soon changed to Java.
• When the home appliance software work dried up, Java almost died before
being released.
• Fortunately for Java, the World Wide Web exploded in popularity and Sun
realized it could capitalize on that.
Page 22Classification: Restricted
Issue of Portability Solved.. But..
• Web pages have to be very portable because they can be downloaded onto
any type of computer.
• What's the standard language used for Web pages?
• Java programs are very portable and they're better than HTML in terms of
providing user interaction capabilities.
• Java programs that are embedded in Web pages are called applets.
• Although applets still play a significant role in Java's current success, some
of the other types of Java programs have surpassed applets in terms of
popularity.
• In this course, we cover Standard Edition (SE) Java applications. They are
Java programs that run on a standard computer – a desktop or a laptop,
without the need of the Internet.
19
Page 23Classification: Restricted
Features Of Java
• Simple
• Similar to C and C++, but without the demerits…
• Omits operator overloading, multiple inheritance
• Goto statement is eliminated
• Header files are eliminated
• No concept of pointers
• Automatic Garbage collection
• A rich set of predefined classes
Page 24Classification: Restricted
Features Of Java
• Object-Oriented
• Forces the programmer to use the classes and object
• Class
• Member variables( data ) and member functions ( methods )
Page 25Classification: Restricted
Features Of Java
• Robust
• designed for writing highly reliable or robust software:
• automatic garbage collection, which prevents memory leaks
• Type safety of data
• Extensive compile time and runtime checking
• Object Oriented Exception Handling of run time errors
• Divide by zero exception.
Page 26Classification: Restricted
Features Of Java
• Architectural Neutral and Interpreted
• compiler generates bytecodes
• Easy to interpret on any machine
• “Write once and run anywhere WORA”
Page 27Classification: Restricted
Features Of Java
• Powerful
• Networking
• Threads
• Distributed Objects
• Database Access
• Graphics
• Data structure library
• Serialization
• Digital Signatures
Page 28Classification: Restricted
Features Of Java
• Java is Popular
Page 29Classification: Restricted
Features Of Java
• Distributed
• Supports TCP/IP
• Remote Method
• Invocation (RMI)
• Web Services
Page 30Classification: Restricted
Features of Java
• Multi-Threaded
• Parallel processing to improve the performance of certain types of
programs
Page 31Classification: Restricted
Major Java Editions
Page 32Classification: Restricted
Setting up environment for
Java Development
MindsMapped Consulting
Page 33Classification: Restricted
Steps for Environment Setup
1. Download and install latest JDK from Oracle site
2. Download and install Eclipse
Page 34Classification: Restricted
Download latest JDK from Oracle site
• "JDK" or "JRE"?
JRE (Java Runtime) is needed for running Java programs. JDK (Java
Development Kit), which includes JRE plus the development tools (such as
compiler and debugger), is need for writing as well as running Java
programs. Since you are supposed to write Java Programs, you should
install JDK, which includes JRE.
• To download and install JDK follow the steps in the following slides.
Page 35Classification: Restricted
Download latest JDK from Oracle site – Step 0
Step 0: Un-Install Older Version(s) of JDK/JRE
• I recommend that you install only the latest JDK. Although you can install
multiple versions of JDK concurrently, it is messy.
• If you have previously installed older version(s) of JDK/JRE, un-install ALL of
them. Goto "Control Panel" ⇒ "Program and Features" ⇒ Un-install ALL
programs begin with "Java", such as "Java SE Development Kit ...", "Java SE
Runtime ...", and etc.
Page 36Classification: Restricted
Download latest JDK from Oracle site – Step 1
Step 1: Download JDK
1. Goto Java SE download site @
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Under "Java Platform, Standard Edition" ⇒ "Java SE 8u{xx}", where {xx} is
the latest update number ⇒ Click the "JDK Download" button.
3. Check "Accept License Agreement".
4. Choose your operating platform, e.g., "Windows x64" (for 64-bit
Windows OS) or "Windows x86" (for 32-bit Windows OS). You can check
whether your Windows OS is 32-bit or 64-bit via "Control Panel" ⇒
"System" ⇒ Under "System Type".
Page 37Classification: Restricted
Download latest JDK from Oracle site – Step 2
Step 2: Install JDK and JRE
1. Run the downloaded installer (e.g., "jdk-8u{xx}-windows-x64.exe"),
which installs both the JDK and JRE. By default, the JDK will be installed
in directory "C:Program FilesJavajdk1.8.0_xx", where xx denotes the
latest upgrade number; and JRE in "C:Program FilesJavajre1.8.0_xx".
2. For novices, accept the defaults. Follow the screen instructions to install
JDK and JRE.
3. Check the JDK installed directory by inspecting these folders using File
Explorer. Take note of your JDK installed directory, which you will need
in the next step.
4. I shall refer to the installation directory as <JAVA_HOME>
Page 38Classification: Restricted
Download latest JDK from Oracle site – Step 3
Step 3: Include JDK's "bin" Directory in the PATH
Windows OS searches the current directory and the directories listed in the PATH environment
variable for executable programs. JDK's programs (such as Java compiler javac.exe and Java
runtime java.exe) reside in directory "<JAVA_HOME>bin" (where <JAVA_HOME> denotes the
JDK installed directory). You need to include "<JAVA_HOME>bin" in the PATH to run the JDK
programs.
To edit the PATH environment variable in Windows XP/Vista/7/8/10:
1. Launch "Control Panel" ⇒ "System" ⇒ Click "Advanced system settings".
2. Switch to "Advanced" tab ⇒ "Environment Variables".
3. Under "System Variables", scroll down to select "Path" ⇒ "Edit...".
4. (CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO)
For Windows 10: You see a table listing the existing PATH entries. Click "New" ⇒ Enter the JDK's
binary directory "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation's
upgrade number!!!) ⇒ Select "Move Up" to move it all the way to the top.
Prior to Windows 10: In "Variable value" field, INSERT "c:Program FilesJavajdk1.8.0_xxbin"
(Replace xx with your installation upgrade number!!!) IN FRONT of all the existing directories,
followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the
existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications
may not run.
Page 39Classification: Restricted
Download latest JDK from Oracle site – Step 4
Step 4: Verify the JDK Installation
Launch a CMD shell (Click "Start" button ⇒ run... ⇒ enter "cmd"; OR from "Start" button ⇒ All
Programs ⇒ Accessories ⇒ Command Prompt).
• Issue "path" command to list the contents of the PATH environment variable. Check to make
sure that your <JAVA_HOME>bin is listed in the PATH.
// Display the PATH entries
prompt> path
PATH=c:Program FilesJavajdk1.8.0_xxbin;[other entries...]
Don't type prompt>, which denotes the command prompt!!! Key in the command (highlighted)
only.
• Issue the following commands to verify that JDK/JRE are properly installed and display their
version:
// Display the JRE version
prompt> java -version
java version "1.8.0_xx"
Java(TM) SE Runtime Environment (build 1.8.0_xx-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
// Display the JDK version
prompt> javac -version
javac 1.8.0_xx
Page 40Classification: Restricted
Download and Install Eclipse
• Download Eclipse from:
http://www.eclipse.org/downloads/packages/release/Neon/2
* Neon is the latest Eclipse release as of today. You can download the
latest Eclipse release.
• To install, all you have to do is extract the zip folder.
• While starting Eclipse, choose a workspace to store all your project files.
• Once Eclipse is launched, point it to the JDK you installed earlier
Preferences -> Java -> Installed JRE's
Page 41Classification: Restricted
Topics to be covered in next session
• Principles of Object Oriented Programming
• Writing your first Java Application
• Elements of Java programming language
• Built in Data Types
• Conditional Statements
• Loops
Page 42Classification: Restricted
Thank you!

More Related Content

PPSX
Strings in Java
PPSX
Arrays in Java
PPSX
Elements of Java Language
PDF
What Is Java | Java Tutorial | Java Programming | Learn Java | Edureka
PDF
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
PDF
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
PPTX
Core java
PDF
Introduction to Java Programming Language
Strings in Java
Arrays in Java
Elements of Java Language
What Is Java | Java Tutorial | Java Programming | Learn Java | Edureka
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Core java
Introduction to Java Programming Language

What's hot (20)

PPTX
Introduction to java
ODP
Basic of Java
PPSX
Introduction to .net framework
PPTX
Introduction to JAVA
PPTX
Presentation on Core java
PPT
Introduction to Java Programming, Basic Structure, variables Data type, input...
PDF
Spring Framework - Core
PPTX
Introduction to java
PDF
Introduction to Android Development
PPTX
core java
PDF
Introduction to java (revised)
PPT
Java Programming for Designers
PPTX
Java Presentation
PDF
Introduction to basics of java
PPTX
Core java
PPTX
Java architecture
PPTX
Presentation on java (8)
PPTX
Training on Core java | PPT Presentation | Shravan Sanidhya
PDF
Introduction to Java
PPTX
Kotlin Basics & Introduction to Jetpack Compose.pptx
Introduction to java
Basic of Java
Introduction to .net framework
Introduction to JAVA
Presentation on Core java
Introduction to Java Programming, Basic Structure, variables Data type, input...
Spring Framework - Core
Introduction to java
Introduction to Android Development
core java
Introduction to java (revised)
Java Programming for Designers
Java Presentation
Introduction to basics of java
Core java
Java architecture
Presentation on java (8)
Training on Core java | PPT Presentation | Shravan Sanidhya
Introduction to Java
Kotlin Basics & Introduction to Jetpack Compose.pptx
Ad

Similar to Introduction to Java (20)

PPTX
Session 01 - Introduction to Java
PPTX
Introduction to Java Part-2
PPTX
Session 02 - Elements of Java Language
PPTX
Introduction to Java
PPTX
Java session2
PPTX
Object Oriented concept-JAVA-Module-1-PPT.pptx
PPTX
OOP-JAVA-UNIT-1-PPT updated.pptx object oriented programming language using java
PPT
Core Java Slides
PPSX
Java Semimar Slide (Cetpa)
PPSX
Java Semimar Slide (Cetpa)
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming
PPTX
1_Introduction to Java.pptx java programming
PPTX
Introduction to Java Part-3
Session 01 - Introduction to Java
Introduction to Java Part-2
Session 02 - Elements of Java Language
Introduction to Java
Java session2
Object Oriented concept-JAVA-Module-1-PPT.pptx
OOP-JAVA-UNIT-1-PPT updated.pptx object oriented programming language using java
Core Java Slides
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
Object oriented programming-with_java
Object oriented programming
Object oriented programming-with_java
Object oriented programming
Object oriented programming-with_java
Object oriented programming
Object oriented programming
1_Introduction to Java.pptx java programming
Introduction to Java Part-3
Ad

More from Hitesh-Java (20)

PPSX
Spring - Part 4 - Spring MVC
PPSX
Spring - Part 3 - AOP
PPSX
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
PPSX
Spring - Part 1 - IoC, Di and Beans
PPSX
JSP - Part 2 (Final)
PPSX
JSP - Part 1
PPSX
Struts 2 - Hibernate Integration
PPSX
Struts 2 - Introduction
PPSX
Hibernate - Part 2
PPSX
Hibernate - Part 1
PPSX
JDBC Part - 2
PPSX
PPSX
Java IO, Serialization
PPSX
Inner Classes
PPSX
Collections - Maps
PPSX
Review Session - Part -2
PPSX
Review Session and Attending Java Interviews
PPSX
Collections - Lists, Sets
PPSX
Collections - Sorting, Comparing Basics
PPSX
Collections - Array List
Spring - Part 4 - Spring MVC
Spring - Part 3 - AOP
Spring - Part 2 - Autowiring, Annotations, Java based Configuration - slides
Spring - Part 1 - IoC, Di and Beans
JSP - Part 2 (Final)
JSP - Part 1
Struts 2 - Hibernate Integration
Struts 2 - Introduction
Hibernate - Part 2
Hibernate - Part 1
JDBC Part - 2
Java IO, Serialization
Inner Classes
Collections - Maps
Review Session - Part -2
Review Session and Attending Java Interviews
Collections - Lists, Sets
Collections - Sorting, Comparing Basics
Collections - Array List

Recently uploaded (20)

PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Comparative analysis of machine learning models for fake news detection in so...
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Flame analysis and combustion estimation using large language and vision assi...
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPT
Geologic Time for studying geology for geologist
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
UiPath Agentic Automation session 1: RPA to Agents
Custom Battery Pack Design Considerations for Performance and Safety
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Comparative analysis of machine learning models for fake news detection in so...
2018-HIPAA-Renewal-Training for executives
sbt 2.0: go big (Scala Days 2025 edition)
Developing a website for English-speaking practice to English as a foreign la...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
sustainability-14-14877-v2.pddhzftheheeeee
Build Your First AI Agent with UiPath.pptx
Flame analysis and combustion estimation using large language and vision assi...
Chapter 5: Probability Theory and Statistics
Benefits of Physical activity for teenagers.pptx
Credit Without Borders: AI and Financial Inclusion in Bangladesh
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Enhancing plagiarism detection using data pre-processing and machine learning...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Geologic Time for studying geology for geologist
Consumable AI The What, Why & How for Small Teams.pdf
UiPath Agentic Automation session 1: RPA to Agents

Introduction to Java

  • 1. Page 0Classification: Restricted Core Java Training Introduction to Java
  • 2. Page 1Classification: Restricted Agenda • History of Java – A Programmer’s Perspective • Salient Features of Java • Major Java Editions
  • 3. Page 2Classification: Restricted Ice Breaking… • Expectation setting… • Bird’s eye view of the training…
  • 5. Page 4Classification: Restricted European Agricultural Revolution: 1700 onwards
  • 7. Page 6Classification: Restricted Evolution of Computer Science – initially based on mechanical systems
  • 8. Page 7Classification: Restricted A point to ponder… • What led to the evolution of electronic computation systems? More specifically… When we already had mechanical computing machines and calculators, what made us base the modern computing systems on electronics?
  • 9. Page 8Classification: Restricted A point to ponder… • What led to the evolution of electronic computation systems? More specifically… When we already had mechanical computing machines and calculators, what made us base the modern computing systems on electronics? • Switching speed. • Wear and tear.
  • 10. Page 9Classification: Restricted Building Blocks of a Basic Modern Computer System • Based on von Neumann architecture • John von Neumann was a Hungarian computer scientist. 2
  • 11. Page 10Classification: Restricted A point to ponder… • Ok, so the CPU is the brain of the computer system. Then why do I need an OS?
  • 12. Page 11Classification: Restricted A point to ponder… • Ok, so the CPU is the brain of the computer system. Then why do I need an OS? • Communicating with the CPU using its instruction set is cumbersome, it is difficult. We need an interpreter.
  • 13. Page 12Classification: Restricted A point to ponder… • Ok, an OS is the interface between the user and the CPU. Then why would I need a programming language?
  • 14. Page 13Classification: Restricted A point to ponder… • Ok, an OS is the interface between the user and the CPU. Then why would I need a programming language? • How would you add functionalities to the software that is not already available in an OS?
  • 15. Page 14Classification: Restricted A point to ponder… • Ok, agreed I would need a programming language. Now, that we already had other languages like C for Procedural Programming, C++ for Object Oriented Programming, why did we have to write another language like Java?
  • 16. Page 15Classification: Restricted A point to ponder… • Ok, agreed I would need a programming language. Now, that we already had other languages like C for procedural programming, C++ for Object Oriented Programming, why did we have to write another language like Java? • Necessity is the mother of invention. There is a business intent behind this invention too. But, what is that requirement?
  • 17. Page 16Classification: Restricted The Compilation Process for Non-Java Programs (like C & C++) Source Code (programming language instructions) Object Code (binary instructions) Programmers write this. Computers run this. Compilers compile source code into object code.
  • 18. Page 17Classification: Restricted History of Java • In the early 1990's, putting intelligence into home appliances was thought to be the next "hot" technology. • Examples of intelligent home appliances: • Coffee pots and lights that can be controlled by a computer's programs. • Televisions that can be controlled by an interactive television device's programs. • Anticipating a strong market for such things, Sun Microsystems in 1991 funded a research project (code named Green) whose goal was to develop software for intelligent home appliances. • An intelligent home appliance's intelligence comes from its embedded processor chips and the software that runs on the processor chips. • Appliance processor chips change often because engineers continually find ways to make them smaller, less expensive, and more powerful. • To handle the frequent turnover of new chips, appliance software must be extremely portable.
  • 19. Page 18Classification: Restricted The Issue of Portability • A piece of software is portable if it can be used on many different types of computers. • Object code is not very portable. As you know, object code is comprised of binary-format instructions. Those binary-format instructions are intimately tied to a particular type of computer. If you've got object code that was created on a type X computer, then the object code can run only on a type X computer. • The Java solution to improve portability: • Java compilers don't compile all the way down to object code. Instead, they compile down to bytecode, which possesses the best features of both object code and source code: • Like object code, bytecode uses a format that works closely with computer hardware, so it runs fast. • Like source code, bytecode is generic, so it can be run on any type of computer.
  • 20. Page 19Classification: Restricted The Compilation Process for Java Programs Java source code object code Java compilers compile source code into bytecode. bytecode When a Java program is run, the JVM translates bytecode to object code.
  • 21. Page 20Classification: Restricted Java Virtual Machine • How can bytecode be run on any type of computer? • As a Java program’s bytecode runs, the bytecode is translated into object code by the computer's bytecode interpreter program. The bytecode interpreter program is known as the Java Virtual Machine, or JVM for short. The JVM is written specifically for every platform.
  • 22. Page 21Classification: Restricted Issue of Portability Solved.. But.. • Originally, Sun planned to use C++ for its home appliance software, but they soon realized that C++ was less than ideal because it wasn't portable enough and it relied too heavily on hard-to-maintain things called pointers. • Thus, rather than write C++ software and fight C++'s inherent deficiencies, Sun decided to develop a whole new programming language to handle its home appliance software needs. • Their new language was originally named Oak (for the tree that was outside project leader James Gosling's window), but it was soon changed to Java. • When the home appliance software work dried up, Java almost died before being released. • Fortunately for Java, the World Wide Web exploded in popularity and Sun realized it could capitalize on that.
  • 23. Page 22Classification: Restricted Issue of Portability Solved.. But.. • Web pages have to be very portable because they can be downloaded onto any type of computer. • What's the standard language used for Web pages? • Java programs are very portable and they're better than HTML in terms of providing user interaction capabilities. • Java programs that are embedded in Web pages are called applets. • Although applets still play a significant role in Java's current success, some of the other types of Java programs have surpassed applets in terms of popularity. • In this course, we cover Standard Edition (SE) Java applications. They are Java programs that run on a standard computer – a desktop or a laptop, without the need of the Internet. 19
  • 24. Page 23Classification: Restricted Features Of Java • Simple • Similar to C and C++, but without the demerits… • Omits operator overloading, multiple inheritance • Goto statement is eliminated • Header files are eliminated • No concept of pointers • Automatic Garbage collection • A rich set of predefined classes
  • 25. Page 24Classification: Restricted Features Of Java • Object-Oriented • Forces the programmer to use the classes and object • Class • Member variables( data ) and member functions ( methods )
  • 26. Page 25Classification: Restricted Features Of Java • Robust • designed for writing highly reliable or robust software: • automatic garbage collection, which prevents memory leaks • Type safety of data • Extensive compile time and runtime checking • Object Oriented Exception Handling of run time errors • Divide by zero exception.
  • 27. Page 26Classification: Restricted Features Of Java • Architectural Neutral and Interpreted • compiler generates bytecodes • Easy to interpret on any machine • “Write once and run anywhere WORA”
  • 28. Page 27Classification: Restricted Features Of Java • Powerful • Networking • Threads • Distributed Objects • Database Access • Graphics • Data structure library • Serialization • Digital Signatures
  • 29. Page 28Classification: Restricted Features Of Java • Java is Popular
  • 30. Page 29Classification: Restricted Features Of Java • Distributed • Supports TCP/IP • Remote Method • Invocation (RMI) • Web Services
  • 31. Page 30Classification: Restricted Features of Java • Multi-Threaded • Parallel processing to improve the performance of certain types of programs
  • 33. Page 32Classification: Restricted Setting up environment for Java Development MindsMapped Consulting
  • 34. Page 33Classification: Restricted Steps for Environment Setup 1. Download and install latest JDK from Oracle site 2. Download and install Eclipse
  • 35. Page 34Classification: Restricted Download latest JDK from Oracle site • "JDK" or "JRE"? JRE (Java Runtime) is needed for running Java programs. JDK (Java Development Kit), which includes JRE plus the development tools (such as compiler and debugger), is need for writing as well as running Java programs. Since you are supposed to write Java Programs, you should install JDK, which includes JRE. • To download and install JDK follow the steps in the following slides.
  • 36. Page 35Classification: Restricted Download latest JDK from Oracle site – Step 0 Step 0: Un-Install Older Version(s) of JDK/JRE • I recommend that you install only the latest JDK. Although you can install multiple versions of JDK concurrently, it is messy. • If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Goto "Control Panel" ⇒ "Program and Features" ⇒ Un-install ALL programs begin with "Java", such as "Java SE Development Kit ...", "Java SE Runtime ...", and etc.
  • 37. Page 36Classification: Restricted Download latest JDK from Oracle site – Step 1 Step 1: Download JDK 1. Goto Java SE download site @ http://www.oracle.com/technetwork/java/javase/downloads/index.html 2. Under "Java Platform, Standard Edition" ⇒ "Java SE 8u{xx}", where {xx} is the latest update number ⇒ Click the "JDK Download" button. 3. Check "Accept License Agreement". 4. Choose your operating platform, e.g., "Windows x64" (for 64-bit Windows OS) or "Windows x86" (for 32-bit Windows OS). You can check whether your Windows OS is 32-bit or 64-bit via "Control Panel" ⇒ "System" ⇒ Under "System Type".
  • 38. Page 37Classification: Restricted Download latest JDK from Oracle site – Step 2 Step 2: Install JDK and JRE 1. Run the downloaded installer (e.g., "jdk-8u{xx}-windows-x64.exe"), which installs both the JDK and JRE. By default, the JDK will be installed in directory "C:Program FilesJavajdk1.8.0_xx", where xx denotes the latest upgrade number; and JRE in "C:Program FilesJavajre1.8.0_xx". 2. For novices, accept the defaults. Follow the screen instructions to install JDK and JRE. 3. Check the JDK installed directory by inspecting these folders using File Explorer. Take note of your JDK installed directory, which you will need in the next step. 4. I shall refer to the installation directory as <JAVA_HOME>
  • 39. Page 38Classification: Restricted Download latest JDK from Oracle site – Step 3 Step 3: Include JDK's "bin" Directory in the PATH Windows OS searches the current directory and the directories listed in the PATH environment variable for executable programs. JDK's programs (such as Java compiler javac.exe and Java runtime java.exe) reside in directory "<JAVA_HOME>bin" (where <JAVA_HOME> denotes the JDK installed directory). You need to include "<JAVA_HOME>bin" in the PATH to run the JDK programs. To edit the PATH environment variable in Windows XP/Vista/7/8/10: 1. Launch "Control Panel" ⇒ "System" ⇒ Click "Advanced system settings". 2. Switch to "Advanced" tab ⇒ "Environment Variables". 3. Under "System Variables", scroll down to select "Path" ⇒ "Edit...". 4. (CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO) For Windows 10: You see a table listing the existing PATH entries. Click "New" ⇒ Enter the JDK's binary directory "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation's upgrade number!!!) ⇒ Select "Move Up" to move it all the way to the top. Prior to Windows 10: In "Variable value" field, INSERT "c:Program FilesJavajdk1.8.0_xxbin" (Replace xx with your installation upgrade number!!!) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run.
  • 40. Page 39Classification: Restricted Download latest JDK from Oracle site – Step 4 Step 4: Verify the JDK Installation Launch a CMD shell (Click "Start" button ⇒ run... ⇒ enter "cmd"; OR from "Start" button ⇒ All Programs ⇒ Accessories ⇒ Command Prompt). • Issue "path" command to list the contents of the PATH environment variable. Check to make sure that your <JAVA_HOME>bin is listed in the PATH. // Display the PATH entries prompt> path PATH=c:Program FilesJavajdk1.8.0_xxbin;[other entries...] Don't type prompt>, which denotes the command prompt!!! Key in the command (highlighted) only. • Issue the following commands to verify that JDK/JRE are properly installed and display their version: // Display the JRE version prompt> java -version java version "1.8.0_xx" Java(TM) SE Runtime Environment (build 1.8.0_xx-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) // Display the JDK version prompt> javac -version javac 1.8.0_xx
  • 41. Page 40Classification: Restricted Download and Install Eclipse • Download Eclipse from: http://www.eclipse.org/downloads/packages/release/Neon/2 * Neon is the latest Eclipse release as of today. You can download the latest Eclipse release. • To install, all you have to do is extract the zip folder. • While starting Eclipse, choose a workspace to store all your project files. • Once Eclipse is launched, point it to the JDK you installed earlier Preferences -> Java -> Installed JRE's
  • 42. Page 41Classification: Restricted Topics to be covered in next session • Principles of Object Oriented Programming • Writing your first Java Application • Elements of Java programming language • Built in Data Types • Conditional Statements • Loops