Download presentation
Presentation is loading. Please wait.
Published byAllyson Cobb Modified over 9 years ago
1
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial - http://java.sun.com/docs/books/tutorial/ http://java.sun.com/docs/books/tutorial/
2
2 About Java Developed by Sun Microsystems Originally intended for intelligent consumer-electronic devices (smart refrigerators, microwave ovens, toasters..)
3
3 About Java (cont.) Java Evolved into a general-purpose, high-level Java programming language which Provides a powerful software platform for the development of applications. Allows writing applets for the Web –An applet is a program that runs within a Java-enabled browser.
4
4 Java Applications: Servers A Java server is a special kind of a Java application which serves and supports client programs on a network Examples of servers: –Mail servers –Proxy serves –Print servers
5
5 A Servlet Another specialized java program –Can almost be thought of as an applet that runs on the server side. –Servlets are similar to applets in that they are runtime extensions of applications –Instead of working in browsers, servlets run within Java Web servers, configuring or tailoring the server
6
6 Basics of a Typical Java Environment (Sec 1.13) Java is unusual in that a program is both compiled and interpreted Java programs normally undergo five phases –Edit Programmer writes program (and stores program on disk) –Compile Compiler creates platform-independent codes called Java bytecodes
7
7 Java Environment (cont.) –Load Class loader stores bytecodes in memory –Verify Verifier ensures bytecodes do not violate security requirements –Execute Interpreter translates bytecodes into machine language
8
8 Fig. 1.1 Typical Java environment. Primary Memory............ Disk Editor Compiler Class Loader Program is created in an editor and stored on disk in a file ending with.java. Compiler creates bytecodes and stores them on disk in a file ending with.class. Class loader reads.class files containing bytecodes from disk and puts those bytecodes in memory. Phase 1 Phase 2 Phase 3 Primary Memory............ Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions. Phase 4 Primary Memory............ Interpreter Interpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes. Phase 5
9
9
10
10 Java Virtual Machine (Java VM). Think of Java bytecodes as the machine code instructions for the Java Virtual Machine (Java VM). A Java interpreter is an implementation of the Java VM A Java interpreter can be: –A development tool that runs aplications –A Web browser that can run applets
11
11 Java Portability Java bytecodes help make "write once, run anywhere" possible. –You can compile your program into bytecodes on any platform that has a Java compiler. –The bytecodes can then be run on any implementation of the Java VM. Java portability: As long as a computer has a Java VM, the same program written in Java can run on Windows 2000, a Solaris workstation, or on an iMac
12
12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.