SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Java Virtual Machine

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 1
Java Virtual Machine - start
Java Source Program
Java Source Program

Program
Program
Running
Running

Java ‘Compiler’
Java ‘Compiler’

Program
Program
Running
Running

JVM on LINUX PC
JVM on LINUX PC

Byte
Byte
Code
Code

JVM on Windows PC
JVM on Windows PC
JVM on iMAC
JVM on iMAC
JVM on UNIX
JVM on UNIX

© Katrin Becker
All rights reserved.

Program
Program
Running
Running

Java Virtual Machine

Program
Program
Running
Running
Jan 18, 2014 2
Java Virtual Machine - source
Java Source Program
Java Source Program

© Katrin Becker
All rights reserved.

-Written in standard Java
-Target machine irrelevant
-Doesn’t matter which machine
it’s created on.

Java Virtual Machine

Jan 18, 2014 3
Java Virtual Machine - compile
Java Source Program
Java Source Program
>> javac MyProg.java

Java ‘Compiler’
Java ‘Compiler’
Java ‘compiler’ does syntactic analysis
and parsing.
Translates source into Byte Code
MyProg.class

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 4
Java Virtual Machine - Byte Code
Java Source Program
Java Source Program
Bytecode is
the same for ALL machines
Java ‘Compiler’
Java ‘Compiler’
and ALL versions of Java
Up to this point everything looks
and behaves identically
on ALL machines
Bytecode is assembler-like, but there
Byte
Byte
is no really real machine that
‘understands’ bytecode.
Code
Code
Called Bytecode because most
instructions are one or two
bytes long
© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 5
Java Virtual Machine – ready-set-..
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

•Bytecode can be transported to
any machine with a bytecode
interpreter [called the “Java
Virtual Machine”]
•Assemblers run on real
machines, so…..
•Java Bytecode runs on a
“Virtual Machine”

Java Virtual Machine

Jan 18, 2014 6
Java Virtual Machine – go
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

•The Virtual Machine is like a
simulator – it simulates a real
machine, but…
•It also ‘tells’ the real machine
on which it is currently running
to do the stuff the virtual
machine would be doing
•This requires it to be ‘tailormade’ for the machine it is
running on…

Java Virtual Machine

Jan 18, 2014 7
Java Virtual Machine - Linux
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’
JVM on LINUX PC
JVM on LINUX PC

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 8
Java Virtual Machine – Linux-b
Java Source Program
Java Source Program

Program
Program
Running
Running

Java ‘Compiler’
Java ‘Compiler’
JVM on LINUX PC
JVM on LINUX PC

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 9
Java Virtual Machine - Windows
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

JVM on Windows PC
JVM on Windows PC

Java Virtual Machine

Jan 18, 2014 10
Java Virtual Machine – Windows-b
Java Source Program
Java Source Program
Program
Program
Running
Running

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

JVM on Windows PC
JVM on Windows PC

Java Virtual Machine

Jan 18, 2014 11
Java Virtual Machine - iMAC
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

JVM on iMAC
JVM on iMAC

Java Virtual Machine

Jan 18, 2014 12
Java Virtual Machine – iMAC-b
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code

© Katrin Becker
All rights reserved.

Program
Program
Running
Running
JVM on iMAC
JVM on iMAC

Java Virtual Machine

Jan 18, 2014 13
Java Virtual Machine - UNIX
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code
JVM on UNIX
JVM on UNIX
© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 14
Java Virtual Machine – UNIX-b
Java Source Program
Java Source Program

Java ‘Compiler’
Java ‘Compiler’

Byte
Byte
Code
Code
JVM on UNIX
JVM on UNIX
© Katrin Becker
All rights reserved.

Java Virtual Machine

Program
Program
Running
Running
Jan 18, 2014 15
Java Virtual Machine ..TA-Da
Java Source Program
Java Source Program

Program
Program
Running
Running

Java ‘Compiler’
Java ‘Compiler’

Program
Program
Running
Running

JVM on LINUX PC
JVM on LINUX PC

Byte
Byte
Code
Code

JVM on Windows PC
JVM on Windows PC
JVM on iMAC
JVM on iMAC
JVM on UNIX
JVM on UNIX

© Katrin Becker
All rights reserved.

Program
Program
Running
Running

Java Virtual Machine

Program
Program
Running
Running
Jan 18, 2014 16
Once more from the top
A slightly different
perspective….

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 17
Java Source :: JVM -1
JVM source written in C
JVM source written in C

Somebody writes the “Java Virtual Machine”;
Jim Gosling probably wrote the first one.

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 18
Java Source :: JVM -2
JVM source written in C
JVM source written in C

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

JVM.c gets compiled to produce….

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 19
Java Source :: JVM -3
JVM source written in C
JVM source written in C

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’
JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

There has to be a specially tailored
one of these for the specific
machine we are currently using.

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 20
Java Source :: JVM –3b
JVM source written in C
JVM source written in C

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’
JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

The ‘Java Virtual Machine’ is now
ready to be used (invoked).
It can sit around on the system
indefinitely.
© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 21
Java Source :: JVM -4
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

Along comes My
Program,
written in Java

© Katrin Becker
All rights reserved.

JVM source written in C
JVM source written in C

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’
JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

Java Virtual Machine

Jan 18, 2014 22
Java Source :: JVM -5
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

>> javac MyProg.java
Results in…..

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

The Java compiler gets invoked –
It takes standard Java source as input
And produces standard Java ByteCode as output
© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 23
Java Source :: JVM -6
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

Now I am free to take my MyProg.class to
any computer I choose,
Any brand; any flavour; anywhere in the world
PROVIDED…
It has a working JVM.exe
© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 24
Java Source :: JVM –6b
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

When I say:
>> java MyProg.class

© Katrin Becker
All rights reserved.

The target machine loads, and then starts to
run the
Java Virtual Machine….
Java Virtual Machine

Jan 18, 2014 25
Java Source :: JVM -7
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

Machine-dependent
Machine-dependent
Linker/Loader
Linker/Loader

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 26
Java Source :: JVM -8
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

Machine-dependent
Machine-dependent
Linker/Loader
Linker/Loader

The JVM expects
a file containing
ByteCode as input
© Katrin Becker
All rights reserved.

‘Java’ Program
‘Java’ Program
Running bytecode
Running bytecode
as input
as input

Java Virtual Machine

Jan 18, 2014 27
Java Source :: JVM -9
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

MyProg.class
MyProg.class
Program
Program
Running
Running
© Katrin Becker
All rights reserved.

The output
JVM.exe
JVM.exe
from the JVM
(executable version of
(executable version of
is the output
JVM)
JVM)
that your
program
Machine-dependent
Machine-dependent
produces
Linker/Loader
Linker/Loader
(unless of
course the
‘Java’ Program
‘Java’ Program JVM detects a
Running bytecode
Running bytecode problem)
as input
as input
Java Virtual Machine

Jan 18, 2014 28
Java Source :: JVM -10
Java Source Program:
Java Source Program:
MyProg.java
MyProg.java

JVM source written in C
JVM source written in C

Java ‘Compiler’
Java ‘Compiler’

C compiler compiles ‘JVM.c’
C compiler compiles ‘JVM.c’

Byte
Byte
Code
Code

JVM.exe
JVM.exe
(executable version of
(executable version of
JVM)
JVM)

Machine-dependent
Machine-dependent
Linker/Loader
Linker/Loader

MyProg.class
MyProg.class
Program
Program
Running
Running
© Katrin Becker
All rights reserved.

‘Java’ Program
‘Java’ Program
Running bytecode
Running bytecode
as input
as input

Java Virtual Machine

MyProg
MyProg
output
output
Jan 18, 2014 29
The end.

© Katrin Becker
All rights reserved.

Java Virtual Machine

Jan 18, 2014 30

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Java JVM
Java JVMJava JVM
Java JVM
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
3. jvm
3. jvm3. jvm
3. jvm
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
JDK,JRE,JVM
JDK,JRE,JVMJDK,JRE,JVM
JDK,JRE,JVM
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
1 Introduction To Java Technology
1 Introduction To Java Technology 1 Introduction To Java Technology
1 Introduction To Java Technology
 
Java notes
Java notesJava notes
Java notes
 
The Real Thing: Java Virtual Machine
The Real Thing: Java Virtual MachineThe Real Thing: Java Virtual Machine
The Real Thing: Java Virtual Machine
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platforms
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming
 
Java introduction
Java introductionJava introduction
Java introduction
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
QSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and JitQSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and Jit
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
Jvm
JvmJvm
Jvm
 
Java compilation
Java compilationJava compilation
Java compilation
 

Andere mochten auch

Android App Development - 02 Activity and intent
Android App Development - 02 Activity and intentAndroid App Development - 02 Activity and intent
Android App Development - 02 Activity and intentDiego Grancini
 
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMHypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMvwchu
 
Virtualization and cloud Computing
Virtualization and cloud ComputingVirtualization and cloud Computing
Virtualization and cloud ComputingRishikese MR
 
Virtualization presentation
Virtualization presentationVirtualization presentation
Virtualization presentationMangesh Gunjal
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing pptMehul Patel
 
Virtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareVirtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareDatapath Consulting
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great InfographicsSlideShare
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShareKapost
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareEmpowered Presentations
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation OptimizationOneupweb
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingContent Marketing Institute
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 

Andere mochten auch (20)

Introduction to virtualization
Introduction to virtualizationIntroduction to virtualization
Introduction to virtualization
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
 
Virtual machine
Virtual machineVirtual machine
Virtual machine
 
Virtual machine subhash gupta
Virtual machine subhash guptaVirtual machine subhash gupta
Virtual machine subhash gupta
 
Android App Development - 02 Activity and intent
Android App Development - 02 Activity and intentAndroid App Development - 02 Activity and intent
Android App Development - 02 Activity and intent
 
Android development session 2 - intent and activity
Android development   session 2 - intent and activityAndroid development   session 2 - intent and activity
Android development session 2 - intent and activity
 
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMHypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
 
Virtual machine
Virtual machineVirtual machine
Virtual machine
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Virtualization and cloud Computing
Virtualization and cloud ComputingVirtualization and cloud Computing
Virtualization and cloud Computing
 
Virtualization presentation
Virtualization presentationVirtualization presentation
Virtualization presentation
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing ppt
 
Virtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareVirtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMware
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great Infographics
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShare
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
 
You Suck At PowerPoint!
You Suck At PowerPoint!You Suck At PowerPoint!
You Suck At PowerPoint!
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 

Ähnlich wie CS Lesson: Introduction to the Java virtual Machine

OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...
OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...
OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...NETWAYS
 
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)jaxLondonConference
 
Decapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptDecapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptAlan Parkinson
 
Building your own Desktop Cloud Environment
Building your own Desktop Cloud EnvironmentBuilding your own Desktop Cloud Environment
Building your own Desktop Cloud EnvironmentJnaapti
 
Installing vmware server 2.0.2 on windows7
Installing vmware server 2.0.2 on windows7Installing vmware server 2.0.2 on windows7
Installing vmware server 2.0.2 on windows7Ravi Kumar Lanke
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
JRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell YouJRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell Youelliando dias
 
Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...
 Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S... Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...
Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...HostedbyConfluent
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezAnthony Alvarez
 
Real time data processing with kafla spark integration
Real time data processing with kafla spark integrationReal time data processing with kafla spark integration
Real time data processing with kafla spark integrationTCS
 
Vagrant for Development
Vagrant for DevelopmentVagrant for Development
Vagrant for DevelopmentJacky Chan
 
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...Ravi Kumar Lanke
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016Hendrik Ebbers
 
Puppet Provisioning Vagrant Virtual Machine
Puppet Provisioning Vagrant Virtual MachinePuppet Provisioning Vagrant Virtual Machine
Puppet Provisioning Vagrant Virtual MachineArpit Aggarwal
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 

Ähnlich wie CS Lesson: Introduction to the Java virtual Machine (20)

OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...
OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...
OSDC 2019 | Virtualisation in Docker, using KVM as Hypervisor by Kososochukwu...
 
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
 
Decapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptDecapitating Selenium with JavaScript
Decapitating Selenium with JavaScript
 
Vagrant
VagrantVagrant
Vagrant
 
Building your own Desktop Cloud Environment
Building your own Desktop Cloud EnvironmentBuilding your own Desktop Cloud Environment
Building your own Desktop Cloud Environment
 
Installing vmware server 2.0.2 on windows7
Installing vmware server 2.0.2 on windows7Installing vmware server 2.0.2 on windows7
Installing vmware server 2.0.2 on windows7
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
JRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell YouJRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell You
 
Java Class1
Java Class1Java Class1
Java Class1
 
Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...
 Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S... Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...
Walking through the Spring Stack for Apache Kafka with Soby Chacko | Kafka S...
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
 
Real time data processing with kafla spark integration
Real time data processing with kafla spark integrationReal time data processing with kafla spark integration
Real time data processing with kafla spark integration
 
Vagrant for Development
Vagrant for DevelopmentVagrant for Development
Vagrant for Development
 
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
 
Puppet Provisioning Vagrant Virtual Machine
Puppet Provisioning Vagrant Virtual MachinePuppet Provisioning Vagrant Virtual Machine
Puppet Provisioning Vagrant Virtual Machine
 
Jvm
JvmJvm
Jvm
 
SFScon 21 - Davide Montesin - Typescript vs. Java
SFScon 21 - Davide Montesin - Typescript vs. JavaSFScon 21 - Davide Montesin - Typescript vs. Java
SFScon 21 - Davide Montesin - Typescript vs. Java
 
GraalVm and Quarkus
GraalVm and QuarkusGraalVm and Quarkus
GraalVm and Quarkus
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 

Mehr von Katrin Becker

Cross breeding animation
Cross breeding animationCross breeding animation
Cross breeding animationKatrin Becker
 
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...Assignments that Meet the Needs of Exceptional Students without Disadvantagin...
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...Katrin Becker
 
T.A.P. : The Teach Aloud Protocol
T.A.P. : The Teach Aloud ProtocolT.A.P. : The Teach Aloud Protocol
T.A.P. : The Teach Aloud ProtocolKatrin Becker
 
Misguided illusions of understanding
Misguided illusions of understandingMisguided illusions of understanding
Misguided illusions of understandingKatrin Becker
 
4 Pillars of DGBL: A Structured Rating System for Games for Learning
4 Pillars of DGBL: A Structured Rating System for Games for Learning4 Pillars of DGBL: A Structured Rating System for Games for Learning
4 Pillars of DGBL: A Structured Rating System for Games for LearningKatrin Becker
 
Gamification paradigm
Gamification paradigmGamification paradigm
Gamification paradigmKatrin Becker
 
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...Katrin Becker
 
Gamification how to gamify learning and instruction Part 1 (of 3)
Gamification how to gamify learning and instruction Part 1 (of 3)Gamification how to gamify learning and instruction Part 1 (of 3)
Gamification how to gamify learning and instruction Part 1 (of 3)Katrin Becker
 
Gamification how to gamify learning and instruction, part 2 (of 3)
Gamification how to gamify learning and instruction, part 2 (of 3)Gamification how to gamify learning and instruction, part 2 (of 3)
Gamification how to gamify learning and instruction, part 2 (of 3)Katrin Becker
 
Is gamification a game changer
Is gamification a game changerIs gamification a game changer
Is gamification a game changerKatrin Becker
 
CS Example: Parsing a Sentence
CS Example: Parsing a Sentence CS Example: Parsing a Sentence
CS Example: Parsing a Sentence Katrin Becker
 
CS: Introduction to Record Manipulation & Indexing
CS: Introduction to Record Manipulation & IndexingCS: Introduction to Record Manipulation & Indexing
CS: Introduction to Record Manipulation & IndexingKatrin Becker
 
CS Lesson: Creating Your First Class in Java
CS Lesson: Creating Your First Class in JavaCS Lesson: Creating Your First Class in Java
CS Lesson: Creating Your First Class in JavaKatrin Becker
 
Informing pedagogy through collaborative inquiry
Informing pedagogy through collaborative inquiryInforming pedagogy through collaborative inquiry
Informing pedagogy through collaborative inquiryKatrin Becker
 
Informing SoTL using playtesting techniques
Informing SoTL using playtesting techniquesInforming SoTL using playtesting techniques
Informing SoTL using playtesting techniquesKatrin Becker
 
Using cards games as learning objects to teach genetics
Using cards games as learning objects to teach geneticsUsing cards games as learning objects to teach genetics
Using cards games as learning objects to teach geneticsKatrin Becker
 
Gamification how to gamify learning and instruction, Part 3 (of 3)
Gamification how to gamify learning and instruction, Part 3 (of 3)Gamification how to gamify learning and instruction, Part 3 (of 3)
Gamification how to gamify learning and instruction, Part 3 (of 3)Katrin Becker
 
The decorative media trap
The decorative media trapThe decorative media trap
The decorative media trapKatrin Becker
 

Mehr von Katrin Becker (20)

Cross breeding animation
Cross breeding animationCross breeding animation
Cross breeding animation
 
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...Assignments that Meet the Needs of Exceptional Students without Disadvantagin...
Assignments that Meet the Needs of Exceptional Students without Disadvantagin...
 
T.A.P. : The Teach Aloud Protocol
T.A.P. : The Teach Aloud ProtocolT.A.P. : The Teach Aloud Protocol
T.A.P. : The Teach Aloud Protocol
 
Misguided illusions of understanding
Misguided illusions of understandingMisguided illusions of understanding
Misguided illusions of understanding
 
Signature pedagogy
Signature pedagogySignature pedagogy
Signature pedagogy
 
Virtue of Failure
Virtue of FailureVirtue of Failure
Virtue of Failure
 
4 Pillars of DGBL: A Structured Rating System for Games for Learning
4 Pillars of DGBL: A Structured Rating System for Games for Learning4 Pillars of DGBL: A Structured Rating System for Games for Learning
4 Pillars of DGBL: A Structured Rating System for Games for Learning
 
Gamification paradigm
Gamification paradigmGamification paradigm
Gamification paradigm
 
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...
The Calm and The Storm: Simulation and Games - Why All Games are Simulations ...
 
Gamification how to gamify learning and instruction Part 1 (of 3)
Gamification how to gamify learning and instruction Part 1 (of 3)Gamification how to gamify learning and instruction Part 1 (of 3)
Gamification how to gamify learning and instruction Part 1 (of 3)
 
Gamification how to gamify learning and instruction, part 2 (of 3)
Gamification how to gamify learning and instruction, part 2 (of 3)Gamification how to gamify learning and instruction, part 2 (of 3)
Gamification how to gamify learning and instruction, part 2 (of 3)
 
Is gamification a game changer
Is gamification a game changerIs gamification a game changer
Is gamification a game changer
 
CS Example: Parsing a Sentence
CS Example: Parsing a Sentence CS Example: Parsing a Sentence
CS Example: Parsing a Sentence
 
CS: Introduction to Record Manipulation & Indexing
CS: Introduction to Record Manipulation & IndexingCS: Introduction to Record Manipulation & Indexing
CS: Introduction to Record Manipulation & Indexing
 
CS Lesson: Creating Your First Class in Java
CS Lesson: Creating Your First Class in JavaCS Lesson: Creating Your First Class in Java
CS Lesson: Creating Your First Class in Java
 
Informing pedagogy through collaborative inquiry
Informing pedagogy through collaborative inquiryInforming pedagogy through collaborative inquiry
Informing pedagogy through collaborative inquiry
 
Informing SoTL using playtesting techniques
Informing SoTL using playtesting techniquesInforming SoTL using playtesting techniques
Informing SoTL using playtesting techniques
 
Using cards games as learning objects to teach genetics
Using cards games as learning objects to teach geneticsUsing cards games as learning objects to teach genetics
Using cards games as learning objects to teach genetics
 
Gamification how to gamify learning and instruction, Part 3 (of 3)
Gamification how to gamify learning and instruction, Part 3 (of 3)Gamification how to gamify learning and instruction, Part 3 (of 3)
Gamification how to gamify learning and instruction, Part 3 (of 3)
 
The decorative media trap
The decorative media trapThe decorative media trap
The decorative media trap
 

Kürzlich hochgeladen

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Kürzlich hochgeladen (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

CS Lesson: Introduction to the Java virtual Machine

  • 1. Java Virtual Machine © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 1
  • 2. Java Virtual Machine - start Java Source Program Java Source Program Program Program Running Running Java ‘Compiler’ Java ‘Compiler’ Program Program Running Running JVM on LINUX PC JVM on LINUX PC Byte Byte Code Code JVM on Windows PC JVM on Windows PC JVM on iMAC JVM on iMAC JVM on UNIX JVM on UNIX © Katrin Becker All rights reserved. Program Program Running Running Java Virtual Machine Program Program Running Running Jan 18, 2014 2
  • 3. Java Virtual Machine - source Java Source Program Java Source Program © Katrin Becker All rights reserved. -Written in standard Java -Target machine irrelevant -Doesn’t matter which machine it’s created on. Java Virtual Machine Jan 18, 2014 3
  • 4. Java Virtual Machine - compile Java Source Program Java Source Program >> javac MyProg.java Java ‘Compiler’ Java ‘Compiler’ Java ‘compiler’ does syntactic analysis and parsing. Translates source into Byte Code MyProg.class © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 4
  • 5. Java Virtual Machine - Byte Code Java Source Program Java Source Program Bytecode is the same for ALL machines Java ‘Compiler’ Java ‘Compiler’ and ALL versions of Java Up to this point everything looks and behaves identically on ALL machines Bytecode is assembler-like, but there Byte Byte is no really real machine that ‘understands’ bytecode. Code Code Called Bytecode because most instructions are one or two bytes long © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 5
  • 6. Java Virtual Machine – ready-set-.. Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. •Bytecode can be transported to any machine with a bytecode interpreter [called the “Java Virtual Machine”] •Assemblers run on real machines, so….. •Java Bytecode runs on a “Virtual Machine” Java Virtual Machine Jan 18, 2014 6
  • 7. Java Virtual Machine – go Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. •The Virtual Machine is like a simulator – it simulates a real machine, but… •It also ‘tells’ the real machine on which it is currently running to do the stuff the virtual machine would be doing •This requires it to be ‘tailormade’ for the machine it is running on… Java Virtual Machine Jan 18, 2014 7
  • 8. Java Virtual Machine - Linux Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ JVM on LINUX PC JVM on LINUX PC Byte Byte Code Code © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 8
  • 9. Java Virtual Machine – Linux-b Java Source Program Java Source Program Program Program Running Running Java ‘Compiler’ Java ‘Compiler’ JVM on LINUX PC JVM on LINUX PC Byte Byte Code Code © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 9
  • 10. Java Virtual Machine - Windows Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. JVM on Windows PC JVM on Windows PC Java Virtual Machine Jan 18, 2014 10
  • 11. Java Virtual Machine – Windows-b Java Source Program Java Source Program Program Program Running Running Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. JVM on Windows PC JVM on Windows PC Java Virtual Machine Jan 18, 2014 11
  • 12. Java Virtual Machine - iMAC Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. JVM on iMAC JVM on iMAC Java Virtual Machine Jan 18, 2014 12
  • 13. Java Virtual Machine – iMAC-b Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code © Katrin Becker All rights reserved. Program Program Running Running JVM on iMAC JVM on iMAC Java Virtual Machine Jan 18, 2014 13
  • 14. Java Virtual Machine - UNIX Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code JVM on UNIX JVM on UNIX © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 14
  • 15. Java Virtual Machine – UNIX-b Java Source Program Java Source Program Java ‘Compiler’ Java ‘Compiler’ Byte Byte Code Code JVM on UNIX JVM on UNIX © Katrin Becker All rights reserved. Java Virtual Machine Program Program Running Running Jan 18, 2014 15
  • 16. Java Virtual Machine ..TA-Da Java Source Program Java Source Program Program Program Running Running Java ‘Compiler’ Java ‘Compiler’ Program Program Running Running JVM on LINUX PC JVM on LINUX PC Byte Byte Code Code JVM on Windows PC JVM on Windows PC JVM on iMAC JVM on iMAC JVM on UNIX JVM on UNIX © Katrin Becker All rights reserved. Program Program Running Running Java Virtual Machine Program Program Running Running Jan 18, 2014 16
  • 17. Once more from the top A slightly different perspective…. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 17
  • 18. Java Source :: JVM -1 JVM source written in C JVM source written in C Somebody writes the “Java Virtual Machine”; Jim Gosling probably wrote the first one. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 18
  • 19. Java Source :: JVM -2 JVM source written in C JVM source written in C C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ JVM.c gets compiled to produce…. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 19
  • 20. Java Source :: JVM -3 JVM source written in C JVM source written in C C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) There has to be a specially tailored one of these for the specific machine we are currently using. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 20
  • 21. Java Source :: JVM –3b JVM source written in C JVM source written in C C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) The ‘Java Virtual Machine’ is now ready to be used (invoked). It can sit around on the system indefinitely. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 21
  • 22. Java Source :: JVM -4 Java Source Program: Java Source Program: MyProg.java MyProg.java Along comes My Program, written in Java © Katrin Becker All rights reserved. JVM source written in C JVM source written in C C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) Java Virtual Machine Jan 18, 2014 22
  • 23. Java Source :: JVM -5 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ >> javac MyProg.java Results in….. JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) The Java compiler gets invoked – It takes standard Java source as input And produces standard Java ByteCode as output © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 23
  • 24. Java Source :: JVM -6 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) Now I am free to take my MyProg.class to any computer I choose, Any brand; any flavour; anywhere in the world PROVIDED… It has a working JVM.exe © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 24
  • 25. Java Source :: JVM –6b Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) When I say: >> java MyProg.class © Katrin Becker All rights reserved. The target machine loads, and then starts to run the Java Virtual Machine…. Java Virtual Machine Jan 18, 2014 25
  • 26. Java Source :: JVM -7 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) Machine-dependent Machine-dependent Linker/Loader Linker/Loader © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 26
  • 27. Java Source :: JVM -8 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) Machine-dependent Machine-dependent Linker/Loader Linker/Loader The JVM expects a file containing ByteCode as input © Katrin Becker All rights reserved. ‘Java’ Program ‘Java’ Program Running bytecode Running bytecode as input as input Java Virtual Machine Jan 18, 2014 27
  • 28. Java Source :: JVM -9 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code MyProg.class MyProg.class Program Program Running Running © Katrin Becker All rights reserved. The output JVM.exe JVM.exe from the JVM (executable version of (executable version of is the output JVM) JVM) that your program Machine-dependent Machine-dependent produces Linker/Loader Linker/Loader (unless of course the ‘Java’ Program ‘Java’ Program JVM detects a Running bytecode Running bytecode problem) as input as input Java Virtual Machine Jan 18, 2014 28
  • 29. Java Source :: JVM -10 Java Source Program: Java Source Program: MyProg.java MyProg.java JVM source written in C JVM source written in C Java ‘Compiler’ Java ‘Compiler’ C compiler compiles ‘JVM.c’ C compiler compiles ‘JVM.c’ Byte Byte Code Code JVM.exe JVM.exe (executable version of (executable version of JVM) JVM) Machine-dependent Machine-dependent Linker/Loader Linker/Loader MyProg.class MyProg.class Program Program Running Running © Katrin Becker All rights reserved. ‘Java’ Program ‘Java’ Program Running bytecode Running bytecode as input as input Java Virtual Machine MyProg MyProg output output Jan 18, 2014 29
  • 30. The end. © Katrin Becker All rights reserved. Java Virtual Machine Jan 18, 2014 30