Java Architecture
Objectives
We would like to
- Discuss the difference between an interpreter and a compiler.
- Understand what the Java Virtual Machine is and what it does.
- Understand what the Java Runtime Environment is
- Understand what the Java Development Kit is.
Notes
- I am using section 1.3 of the book
- If I have a document
- like a program or a speech written in one language
- that I want in another language.
- I need to translate that document.
- In the computing world we developed several ways to do this
- An interpreter
- will read one line at a time and translate it to the new language.
- But generally does not record that line.
- So if you encounter the line again, you need to translate it again.
- Think translating a speech in real time.
- A compiler
- Translates the entire document at one time to the new language
- So it is slower at first.
- But faster as it does not need interpreted each time.
- Generally all syntax errors need to be removed before you can compile a program.
- Java chose both of these.
- For portability sake, java runs on t e Java virtual Machine.
- This is a computer emulator or virtual computer.
- It runs a machine code called Java bytecode.
- For each new hardware/operating system combination, the JVM must be implemented.
- Then all java programs can be run on this platform.
But Java bytecode is still hard to read and work with.
- So the Java compiler translates from Java to Java bytecode.
- You will need to install these two pieces.
- The JRE
- For a discussion see Oracle Documentation
- This contains
- The java virtual machine
- Libraries
- This most likely installed on your computer already.
- But if not you will need to install this.
- The JDK
- This contains the java compilers
- And other things necessary to develop code.
- We will discuss installing both of theses in the next video.