java
Post on 06-Jan-2016
43 Views
Preview:
DESCRIPTION
TRANSCRIPT
3/5/2002 e-business and Information Systems 1
JavaJavaJava
•Java Virtual Machine (JVM)
•Java Application Program Interface (API)
HW
Kernel
API
Application Programs
JVM
Java APIs
Java Application
3/5/2002 e-business and Information Systems 2
Java APIsJava APIs
Client-Side applications
Server-Side applications
Client/Server applications
Internet (Web) applications
3/5/2002 e-business and Information Systems 3
JAVA CompilerJAVA Compiler
Java Compiler
Source
Code
Java
Byte Code
Readable
by
human
Executable
by
JVM
javac
3/5/2002 e-business and Information Systems 4
JAVA Virtual Machine JAVA Virtual Machine (JVM)(JVM)
JVM - JRE
Java
Byte Code
Executable
by
JVM
java
JVM for Windows
HP OS
Windows OS
Linux OS
Mac OS
JVM for Linux
JVM for HP
JVM for Mac
interpreter
3/5/2002 e-business and Information Systems 5
JavaJavaSoftware Development KitSoftware Development Kit
Download and install:
SDK 1.3 or higher
Commands in bin directory:
• javac – java compiler
• java - execution
• jar – java zip/tar
3/5/2002 e-business and Information Systems 6
Java Example:Java Example:Source CodeSource Code
//File: HelloWorld.javaimport java.io.*;
public class HelloWorld {
public static void main(String[] args){System.out.println("Hello World!"); } //End of main } //End of class
3/5/2002 e-business and Information Systems 7
Java Example:Java Example:Generate Byte CodeGenerate Byte Code
Source Code: HelloWorld.java
Set Path: set path=c:\sdk1.3\bin;%path%
Compile: javac HelloWorld.java
Byte code: HelloWorld.class
3/5/2002 e-business and Information Systems 8
Java Example:Java Example:Execute ByteCodeExecute ByteCode
java HelloWorld
3/5/2002 e-business and Information Systems 9
Java Example:Java Example:Windows98 - DOSWindows98 - DOS
top related