Full HTML for

Basic foilset Introduction to Java to be used in (Scientific) Computing

Given by Geoffrey C. Fox, Nancy McCracken at CEWES Java Tutorial on Spring Semester 98. Foils prepared 16 May 98
Outside Index Summary of Material


Introduction to Applications and Applets
The 3 uses of Java in computing
The 3-tier web-based computing model
Java for parallel computing
Performance of Java
History of Java Development
Comparison of Java and JavaScript
Overall Java Philosophy and Features including security etc.

Table of Contents for full HTML of Introduction to Java to be used in (Scientific) Computing

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient

1 Using Java In Scientific Computing Introduction
2 Abstract of Introduction to Java for CSE Tutorial
3 What and Why is Java in a Nutshell?
4 Overview -- Java and either the World Wide Web or Scientific Computing
5 Why use the Web as basis for HPCC/Scientific Computing Software?
6 Java and Parallel or Distributed Computing
7 Java Applications and Applets and their use from HTML
8 Structure of Java Applets
9 Structure of a Java Application
10 Overview -- What are Java applets in detail?
11 Running a Java Applet
12 Java Applications in a Nutshell
13 The Simplest Java Application: Hello, World!
14 Java Applets - I
15 Java Applets - II
16 Applet Tag: Calling Applets from HTML - I
17 Applet Tag: Calling Applets from HTML - II
18 <param> Tags and Applets
19 The Simplest Java Applet: Hello, World!
20 Displaying your applet from a Web page.
21 General Discussion of Role of Java in Scientific and other Computing Applications
22 The Computing Pyramid
23 More General 3 Level Software Model Functionality Performance Tradeoff
24 Computing Services at 3 levels
25 There are (at least) 3 Major Roles for JAVA in Computation -- i.e. it has a role at each layer
26 A Web-based 3-Tier Computing System
27 WebWindows Computing Architecture
28 The 3 Roles of Java
29 General Web Architecture
30 Role of Collaboratory Systems
31 What Limits Performance of Compiled Java?
32 Java and Parallelism?
33 "Pure" Java Model For Parallelism
34 Java -- Interpreters and Compilers
35 Comparison of Java and JavaScript -- I
36 Comparison of Java and JavaScript -- II
37 Overall Features of Java and Associated Enterprises
38 History of Java Language and Team
39 History of Java Language and Team till December 95
40 JDK 1.0 -- The Java Development Kit!
41 JDK 1.1 -- Java grows!
42 Java Web Servers
43 Overall Java Philosophy and Features
44 Some Key Java Features
45 Java Features -- It's Simple and Familiar!
46 Java Features -- It's Object-oriented
47 Java Features -- It's Architecture-Neutral
48 Java Features -- It's Portable
49 Java Features -- It's Somewhat Interpreted
50 Java Features -- It's Distributed and this is a basis for parallelism
51 Java Features -- It's Robust
52 Java Features -- It's (Hopefully) Secure
53 Java Features -- High Performance
54 Java Features -- It's Multithreaded
55 Java Features -- It's Dynamic
56 Java Books -- I
57 Java Books -- II
58 Java Books -- III
59 Resources for the Java Programming Language

Outside Index Summary of Material



HTML version of Basic Foils prepared 16 May 98

Foil 1 Using Java In Scientific Computing Introduction

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Geoffrey Fox
Nancy McCracken
Syracuse University
NPAC
111 College Place Syracuse NY 13244 4100

HTML version of Basic Foils prepared 16 May 98

Foil 2 Abstract of Introduction to Java for CSE Tutorial

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Introduction to Applications and Applets
The 3 uses of Java in computing
The 3-tier web-based computing model
Java for parallel computing
Performance of Java
History of Java Development
Comparison of Java and JavaScript
Overall Java Philosophy and Features including security etc.

HTML version of Basic Foils prepared 16 May 98

Foil 3 What and Why is Java in a Nutshell?

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
What is Java?
  • A simple, object oriented, distributed, interpreted, robust, safe, architecture neutral, portable, high performance, multithreaded, dynamic language.
Java is interesting because
  • It is both a general purpose object-oriented language along the lines of C++
  • and it is particularly designed to interface with Web pages and to enable distributed applications over the internet.
  • It has/will have wonderful tools to support it with best general purpose libraries even seen
Java will dominate as Web will dominate and drive Java as best supported, most widely taught language
  • Particularly good as language for K-12 teaching
  • Even outside Web, e.g. in scientific computing, Java is as good as and in some (modest) respects better than all other languages

HTML version of Basic Foils prepared 16 May 98

Foil 4 Overview -- Java and either the World Wide Web or Scientific Computing

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Browsers (HotJava, Netscape 2.0/3.0/4.0 Microsoft IE ..) supporting Java allow arbitrarily sophisticated dynamic multimedia applications inserts called Applets, written in Java, to be embedded in the regular HTML pages and activated on each exposure of a given page.
  • Wonderful graphics output and widespread access at some security and performance limitations
Regular compilers allow one to run Java Applications with as much efficiency as C and Fortran
  • Can either convert existing code to Java or better access in original form. So inherit all Fortran and C numerical libraries

HTML version of Basic Foils prepared 16 May 98

Foil 5 Why use the Web as basis for HPCC/Scientific Computing Software?

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
HPCC is a small field and Scientific Computing a modest size field with limited resources for very hard problems and must leverage as much software as possible
Web Software provides an excellent pervasive user interface with Java Applets and WebWindows
Web Software provides a potentially excellent high performance object oriented language (Java) for scientific and engineering computation
All(!?) we need to do is to add high performance and special features of scientific computing (math libraries) to the Web!
Technology for generating parallelism (user decomposition, parallelizing compilers) not provided by web and must come from HPCC

HTML version of Basic Foils prepared 16 May 98

Foil 6 Java and Parallel or Distributed Computing

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Web Software provides a high functionality but modest performance distributed computing environment based on either Web Servers or Clients
  • We will use servers for control as higher functionality than clients although currently less broadly deployed
  • Some "parallel" computing problems (e.g. embarrassingly parallel ones) can "immediately" use Web as a parallel engine with no performance enhancements
  • Applications like CFD can usually not run efficiently in parallel on distributed systems without careful software
Web Only addresses Integration of already decomposed parts!

HTML version of Basic Foils prepared 16 May 98

Foil 7 Java Applications and Applets and their use from HTML

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index

HTML version of Basic Foils prepared 16 May 98

Foil 8 Structure of Java Applets

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java Code in
.java files
JavaVM Bytecodes
in .class files
Run through javac compiler
Store .class files
on Web Server
Download .class files
"automatically"
from server to client
using Applet tag
in HTML Pages
Interpreter on client
converts .class files
into native machine
code for client
computer

HTML version of Basic Foils prepared 16 May 98

Foil 9 Structure of a Java Application

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Run through
1)javac or 2)native optimizing compiler
Java Code in
.java files
1) .class file
2)Native Machine Code for target machine
Run
1)java interpreter or
2)native code on
favorite client or server

HTML version of Basic Foils prepared 16 May 98

Foil 10 Overview -- What are Java applets in detail?

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Applet constructs are implemented in terms of a
  • special HTML tag: <APPLET codebase="URL directory path" code="Java class file name" width="numberpixels" height="numberpixels" >
  • where the URL and class file name points to a chunk of server side software that is to be downloaded and executed at the client side on each presentation of a page containing this applet which executes in window specified in size by width and height in pixels.

HTML version of Basic Foils prepared 16 May 98

Foil 11 Running a Java Applet

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Steps to running a Java Applet:
  • 1. Write an HTML file that refers to the applet using the APPLET tag, described in later pages.
  • 2. If necessary, write the Java code and compile into .class files
  • 3. Visit the HTML file with a web browser or with appletviewer.
Using a Browser
  • With a Java-enabled web browser, such as Netscape 2.0/3.0/4.0, Microsoft Internet Explorer or HotJava, you run an applet by "surfing" to a web page containing the APPLET tag.
Using appletviewer
  • When doing development, use appletviewer to run applets by specifying the HTML file on the command line:
    • appletviewer stock.html

HTML version of Basic Foils prepared 16 May 98

Foil 12 Java Applications in a Nutshell

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
All Java programs are written into a file with a ".java" extension.
Applications are .java files with a main class which is excuted first.
How to compile and run a Java application:
  • Run the compiler on a .java file:
  • javac MyProgram.java
  • producing a file "MyProgram.class" of JavaVM bytecodes
  • Run the interpreter on a .class file:
  • java MyProgram
  • which executes the bytecodes
The resources javac and java are part of JDK and are not in Netscape and so are not necessarily available on the same machine as your web server.

HTML version of Basic Foils prepared 16 May 98

Foil 13 The Simplest Java Application: Hello, World!

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Since Java is object-oriented, programs are organized into modules called classes, which may have data in variables and functions called methods.
class HelloWorld
{ public static void main (String[] args )
{ System.out.println("HelloWorld");
}
}
Each program is enclosed in a class definition
main() is first routine that is run
Syntax is similar to C
Use braces for brackets and
semicolons after each statement
Upper and lower case matter!
This notation is
Package.class.method and is
used to refer to public methods in other classes
use class.method if package included
some classes can be accessed automatically

HTML version of Basic Foils prepared 16 May 98

Foil 14 Java Applets - I

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java applets are classes written in Java which are intended not to run as stand-alone programs (as applications do) but as subprograms of a browser which is already managing a window.
Applets should NOT have main method but rather methods such as
  • init, start, paint etc. for displaying on the browser window
The applet should be run through javac compiler getting a MyApplet.class file as before:
  • javac MyApplet.java
Also create an HTML file (say MyApplet.html) with an applet tag referencing MyApplet.class.

HTML version of Basic Foils prepared 16 May 98

Foil 15 Java Applets - II

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Two ways to run an applet:
  • If you have JDK on one's machine, one can run the applet with appletviewer
  • appletviewer MyApplet.html
  • Alternatively, run Netscape 2.0/3.0/4.0 or Internet Explorer essentially anywhere,
  • point the browser at MyApplet.html, and applet is downloaded from the web server and run by Java interpreter built into the browser.
  • This requires that the .html and .class files are located in the document space of the web server.
This way we can compile on places with JDK installed but run almost anywhere!

HTML version of Basic Foils prepared 16 May 98

Foil 16 Applet Tag: Calling Applets from HTML - I

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Given the following HTML
  • <APPLET CODE="StockGraph.class"
    • CODEBASE="http://www.javasoft.com/applets/"
    • WIDTH=200 HEIGHT=200>
  • </APPLET>
Runs the "StockGraph.class" executable as an applet.
WIDTH and HEIGHT are attributes that are passed along to the applet.
If the optional CODEBASE attribute is provided, then load the executable image from the directory specified by CODEBASE.
  • Without the CODEBASE attribute, will look for StockGraph.class in the local server's hierarchy (relative to where the HTML was loaded)
  • With the CODEBASE attribute, will look for StockGraph.class on the given http hierarchy.
Tag and attribute names are case insensitive.

HTML version of Basic Foils prepared 16 May 98

Foil 17 Applet Tag: Calling Applets from HTML - II

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
<APPLET CODE="StockGraph.class" WIDTH=200 HEIGHT=200
ALT="-- StockGraph Not Supported --"
NAME=SUNW ALIGN=top
VSPACE=5 HSPACE=5>
Put a bunch of text here to be displayed by browsers such as Netscape 2.0 on Windows 3.1 that do not support Java
</APPLET>
ALT specifies text to displayed if the browser understands the applet tag, but if unable to run applets.
NAME specifies the name of this instance of the applet; This will make it possible for applets on the same page to find and communicate with each other.
ALIGN specifies the alignment of the applet. The possible values are the same as those available in the IMG tag (top, middle, bottom, texttop, absmiddle, baseline, absbottom, left, right).
  • Align=top which aligns top of applet with top of tallest item in the line
  • Align=texttop which aligns top of applet with top of the tallest text in the line
VSPACE and HSPACE specifies the vertical and horizontal spacing in pixels, around the applet space.

HTML version of Basic Foils prepared 16 May 98

Foil 18 <param> Tags and Applets

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
The applet tag can be followed by parameters:
  • <applet . . . >
  • <param name=attributename1 value="attributevalue1" >
  • .......
  • <param name=attributenameN value="attributevalueN" >
  • </applet>
The Java program accesses this information by
  • String attribute;
  • attribute = getParameter("attributename1");
  • if( attribute == null )
  • attribute = yourdefaultvalue;
  • // null is Java way of saying unset
Typically this processing would be in init() method of Applet

HTML version of Basic Foils prepared 16 May 98

Foil 19 The Simplest Java Applet: Hello, World!

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java applets are part of the class hierarchy that can call methods to display on a screen (within the browser window). This example defines the public method paint in this class and calls a method drawString defined in the class Graphics.
import java.awt.Graphics;
public class HelloWorldApplet extends java.applet.Applet
{ public void paint(Graphics g)
{ g.drawString("Hello World!",5,25); }
}
The paint method displays a graphics object on the screen
one of the standard methods that replaces main for applets
The import statement is similar to an include and makes all the method
names in the Graphics class in the awt package available
Puts this as a subclass of Applet
Drawstring is one of many
available display methods

HTML version of Basic Foils prepared 16 May 98

Foil 20 Displaying your applet from a Web page.

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
You should name the file with your applet name, HelloWorldApplet.java, run the javac compiler getting a JavaVM bytecode file HelloWorldApplet.class which you put in a web directory
<html><head>
<title> Simple Hello World Page </title>
</head>
<body>
My Java Applet says!
<applet code="HelloWorldApplet.class" width=150
height=25 >
</body> </html>
Name of your applet class
Browser uses a rectangle of width 150 pixels
and height 25 pixels to display the applet

HTML version of Basic Foils prepared 16 May 98

Foil 21 General Discussion of Role of Java in Scientific and other Computing Applications

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index

HTML version of Basic Foils prepared 16 May 98

Foil 22 The Computing Pyramid

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Bottom of Pyramid has 1000 times dollar value and compute power of best supercomputer (tip of pyramid) but supercomputer has high performance network to support close synchronization needed by classic parallel algorithms

HTML version of Basic Foils prepared 16 May 98

Foil 23 More General 3 Level Software Model Functionality Performance Tradeoff

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Building from bottom of Computing pyramid starts with high functionality software which has a distributed architecture that can be augmented with high performance
3 Levels of Software
  • Client Interfaces
  • Middleware based on high functionality Web Integration based on network of Web (Java) Servers
  • that can access to a service layer includes scientific computing modules which is viewed as one of many services which also include CORBA, Databases
  • Communication done in middle layer unless high performance needed
One universal language -- Java for all layers

HTML version of Basic Foils prepared 16 May 98

Foil 24 Computing Services at 3 levels

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
1:User View: Interoperable Web Interface accessing services through Java Compute Services Framework 2:Network of Java Servers provide distributed services to databases, compute engines, collaboratories, object brokers, instruments
  • All control at this level
  • Some coarse grain computing
Back end "Number Crunchers" linked either by communication at level 2 (slowish but easy) or at level 3 (high performance but more work)
Compute processes linked either to servers or together by MPI if parallel
Java Servers

HTML version of Basic Foils prepared 16 May 98

Foil 25 There are (at least) 3 Major Roles for JAVA in Computation -- i.e. it has a role at each layer

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java for the User Interface: This is roughly the "WebWindows Philosophy" of building applications to Web Server/Client Standards
  • Java has unique advantages over other languages
Java for Coarse Grain Software Integration: as in collaboration and metacomputing
  • Java has unique advantages over other languages
Java as a high performance scientific language: for "inner" (and outer) loops
  • Here both parallel and sequential issues are important
  • Java as good as other languages with higher performance than C++ and advantages of object oriented programming over Fortran and C

HTML version of Basic Foils prepared 16 May 98

Foil 26 A Web-based 3-Tier Computing System

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Middle Tier
Basic Web Server
Custom Web Server
TP Server
Business Transaction Management
You Write Software
at Client and Server
Perl Java
Old and New Useful Backend Software

HTML version of Basic Foils prepared 16 May 98

Foil 27 WebWindows Computing Architecture

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Client runs Java JavaScript etc.
Services
Web Server Enhanced with Perl Java etc.
Critical
Backend Services such as databases
computing in
C++ Fortran
Java etc.

HTML version of Basic Foils prepared 16 May 98

Foil 28 The 3 Roles of Java

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index

HTML version of Basic Foils prepared 16 May 98

Foil 29 General Web Architecture

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
We have a set of Services hosted by Web Servers and accessed by clients
Groups of clients (electronic societies) are linked by collaboration systems such as TANGO
Access
Resources
Store
Multimedia Information
TANGO Server
File Systems
and/or Database
Object Broker
Database
Simulation
Computer
Person2
Shared
WhiteBoard
Shared Client Appl
Person1
General User

HTML version of Basic Foils prepared 16 May 98

Foil 30 Role of Collaboratory Systems

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Systems like Tango or Habanero built around Java Servers integrate a group of multiple clients as a "Service" at the middle Java Server level
Group of collaborating clients
and client applications
Database
Object Broker
MPP

HTML version of Basic Foils prepared 16 May 98

Foil 31 What Limits Performance of Compiled Java?

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Syracuse and Las Vegas Workshops saw no serious problem to High Performance Java on sequential or Shared Memory Machines
Some restrictions are needed in programming model
  • Cynic says write in Fortran with Curly Brackets but more seriously restrictions requires programming discipline but still exploit key advantages of Java
For instance, Avoid Complicated Exception handlers in areas compilers need to optimize!
Should be able to get comparable performance on compiled Java C and Fortran starting with either Java Language or JavaVM bytecodes
The Interpreted (Applet) JavaVM mode would always be slower than compiled Java/C/Fortran -- perhaps by a factor of two with best technology

HTML version of Basic Foils prepared 16 May 98

Foil 32 Java and Parallelism?

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
The Web integration of Java gives it excellent "network" classes and support for message passing.
Thus "Java plus message passing" form of parallel computing is actually somewhat easier than in Fortran or C.
Coarse grain parallelism very natural in Java
"Data Parallel" languages features are NOT in Java and have to be added (as a translator) of HPJava to Java+Messaging just as HPF translates to Fortran plus message passing
Java has built in "threads" and a given Java Program can run multiple threads at a time
  • In Web use, allows one to process Image in one thread, HTML page in another etc.
Can be used to do more general parallel computing but only on shared memory computers
  • JavaVM does not support distributed memory systems

HTML version of Basic Foils prepared 16 May 98

Foil 33 "Pure" Java Model For Parallelism

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Combine threads on a shared memory machine with message passing between distinct distributed memories
"Distributed" or "Virtual" Shared memory does support the JavaVM as hardware gives illusion of shared memory to JavaVM
Message Passing
Message Passing

HTML version of Basic Foils prepared 16 May 98

Foil 34 Java -- Interpreters and Compilers

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Note Java also integrates compiled and interpreted approaches and so leads to more convenient programming environments
  • Develop and Test with Interpreters
  • Production Run with high performance using compilers and optimized libraries
JavaScript is a fully interpreted language but not really Java
Applets are half-way between traditional compiled and interpreted approaches
Web "systems" can behave like Interpreters with interactive commands at client
Web Client
including
Java Applets
Web Server
Java Application Backend

HTML version of Basic Foils prepared 16 May 98

Foil 35 Comparison of Java and JavaScript -- I

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Netscape renames Livescript as Javascript and this is an interesting variant of Java which is fully interpreted (code can be included directly in HTML file)-- use for overall customization of client
Use Java for detailed programming and JavaScript for overall integration of client interface and system
JavaScript: Interpreted by client and NOT compiled
Java: Compiled on Server before execution on client
  • Note both are reasonably "pure" C/C++ like languages
JavaScript: Object based -- no classes or inheritance -- built in extensible objects
Java: Object-oriented -- Programs consist of object classes with inheritance

HTML version of Basic Foils prepared 16 May 98

Foil 36 Comparison of Java and JavaScript -- II

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
JavaScript: Integrated with HTML as embedded ascii but of course HTML looks rather irrelevant at times!
Java: Applets distinct from HTML but invoked from HTML Pages
JavaScript: do not declare variables' datatypes -- Loose typing
Java: MUST declare variables' datatypes -- Strong typing
JavaScript -- Dynamic Binding -- object references computed at runtime
Java -- Static Binding -- object references must exist at compile time
Java and JavaScript are secure and cannot write to disk
JavaScript has most user interface features of Java (such as buttons and frames), but not mouse interactions like "dragging".

HTML version of Basic Foils prepared 16 May 98

Foil 37 Overall Features of Java and Associated Enterprises

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index

HTML version of Basic Foils prepared 16 May 98

Foil 38 History of Java Language and Team

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Starts in 1991 by Project Green --- a group in Sun that detaches from the main campus as a semi-autonomous task force focused on operating software for consumer electronic devices such as smart set-top boxes
Gosling (creator of Sun NeWS which had major conceptual impact both on current Java and Telescript models) realizes that C++ is not adequate and initiates development of a new language Oak, later renamed as Java.
A PDA (Personal Digital Assistant -- codename *7) based on Oak/Java ready in 1993. Green Team incorporates as FirstPerson, Inc.
*7 proposal to Time-Warner rejected in 1993. 3DO deal falls through in 1994. FirstPerson, Inc. dissolves.
Small group (then ~30 people, now Java Team) continues development and decides to adapt Oak as a Web technology.

HTML version of Basic Foils prepared 16 May 98

Foil 39 History of Java Language and Team till December 95

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
An experimental web browser written in Java, called WebRunner and later renamed as HotJava, ready in 1994.
Alpha release of Java and browser HotJava April '95.
Netscape licences Java in May '95 and builds Java into Netscape 2.0 -- This confuses ownership and open-ness of Java
Beta JDK (Java Development Kit) published in summer/fall '95. It is better software but lower functionality than Alpha.
First alpha Java books appear in fall '95 such as a popular overview by SAMS and technical book "Java!" by Tim Ritchey, edited by New Riders.
Dec 4 1995 Business Week cover story on "Software Revolution --- The Web Changes Everything" exposes Java as a breakthrough force in the expanding Web/Internet. Also points out that "Java as a business" is yet to be defined.
In next week, SGI IBM Adobe Macromedia and finally Microsoft adopt/license Java.
  • Java goes into open standards process and is adopted by Web community.

HTML version of Basic Foils prepared 16 May 98

Foil 40 JDK 1.0 -- The Java Development Kit!

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
The beta version of Java, Version 1.0 of JDK released January 96 by JavaSoft.
JDK 1.0 becomes the Internet standard and so compatible with ongoing Java implementations by all licensees, most notably Netscape and Microsoft. Beta/1.0 JDK includes:
  • Java Compiler (.java to .class) for Sun Solaris and Windows NT/95 avaliable as .class itself (Javac written in Java) but no source
  • Java source for the foundation classes (modified and incompatible with alpha)
  • appletviewer to run/preview applets
  • Source code for the interpreter

HTML version of Basic Foils prepared 16 May 98

Foil 41 JDK 1.1 -- Java grows!

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
A substantial new version of Java released March 97 by JavaSoft.
This release includes many developments both by Sun and by partner companies such as IBM. There are minimal changes to the language - primarily development of new classes to support enterprise computing.
We are currently (Sept 97) ending a transitory situation where a few preleased features of JDK 1.1 such as the Java DataBase Connection (JDBC) are supported by the primary browser Netscape 3.0 and Internet Explorer 3.0, but most JDK 1.1 features are not yet supported in commonly available browsers, except for HotJava.
  • Netscape 4.0 and Internet Explorer 4.0 do support JDK 1.1
  • JavaBean visual components are particularly useful for computing
http://www.javasoft.com/products/jdk/1.1

HTML version of Basic Foils prepared 16 May 98

Foil 42 Java Web Servers

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Originally, the Java Interpreter was incorporated into browsers such as those from Netscape and Microsoft, but the Web server remained a standard one.
Now Web servers are being developed in Java itself. This leads to more natural integration of the use of Java applets on the Web browsers and Java applications running on the Web server machine.
  • Java WebServer from Sun - http://jserv.javasoft.com/ - This web server is developed following new Java Server API, which allows for security and encryption servers. WebServer will run Java applications, called servlets, on the server side similarly to CGI scripts.
  • Jigsaw from the W3 Consortium - http://www.w3.org/pub/WWW/Jigsaw - This web server had the most services but is currently being rewritten so that the model for running Java on the server side will be JavaBeans.

HTML version of Basic Foils prepared 16 May 98

Foil 43 Overall Java Philosophy and Features

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index

HTML version of Basic Foils prepared 16 May 98

Foil 44 Some Key Java Features

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Document The Java: A White Paper by Sun Microsystems -- October 1995 draft by James Gosling and Henry McGilton -- enumerates the original design of Java:
Simple and Familiar
Object-oriented
Architecture-neutral
Portable
Somewhat Interpreted
Distributed
Robust
Secure
High performance
Multi Threaded
Dynamic

HTML version of Basic Foils prepared 16 May 98

Foil 45 Java Features -- It's Simple and Familiar!

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java omits several rarely used, poorly understood and confusing features of C++ including operator overloading, multiple inheritance, pointers and automatic type coercions.
It adds automatic garbage collection which makes dynamic programming easier in Java than in C or C++.
  • No more mallocs!
It also adds 'Interface' construct, similar to Objective C concept, which often compensates for the lack of multiple inheritance by allowing method calling syntax to be "inherited".
The resulting language is familiar as it looks like C++ but is simpler and hence easier to program in.
Simplicity makes it easier to write optimizing compilers and so produce efficient code
It also results in a much smaller kernel which is suitable for planned Java ports to consumer electronic devices.

HTML version of Basic Foils prepared 16 May 98

Foil 46 Java Features -- It's Object-oriented

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java model can be viewed as a C++ subset, with some dynamic elements inherited from Objective-C (method overloading, garbage collection).
Structures, Unions and Functions are absorbed into data and methods of Java classes -- Java is Simple!
The strength of Java object-oriented model is not is sophistication but in simplicity and the extensive class library associated with the system
Java object structure makes all programming including scientific programming easier
  • Fortran90 has some object oriented features but much less elegant than that of Java
  • so go from Fortran77 to Java and not Fortran77 to Fortran90

HTML version of Basic Foils prepared 16 May 98

Foil 47 Java Features -- It's Architecture-Neutral

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
C/C++ programming in a heterogeneous network environment requires use and compatibility across several vendor platforms and the corresponding compilers. This problem is solved in Java by designing platform-independent binary representation called Java bytecode (or javaVM).
  • Makes it a lot easier to distribute your code to your colleagues
Some concerns that Java requires same results on all platforms and so leads to inefficient execution
So have architecture neutral version with same answer on all platforms in applet mode
Run optimizing compiler giving directly native machine code with architecture dependent answers (e.g. Pentium calculates floating internally to 80 bit precision -- not 64 as Java requires!) and high performance

HTML version of Basic Foils prepared 16 May 98

Foil 48 Java Features -- It's Portable

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java language offers a uniform abstract (virtual) machine model which is identical for all platforms.
SUN owns the Java Virtual Machine -- it is universal while classes can be added by any user
Unlike in C/C++ where various integers match the architecture of a physical machine at hand, Java byte, char short, int and long are always of the same size, equal to 8, 16, 16(unicode), 32 and 64 bits, respectively.
  • No header files, preprocessors,#define etc.
  • floating point is always IEEE 754 (not quite right yet!)
Differences between vendor specific windowing environments (X Windows, MS Windows, Macintosh) are removed in terms of the Abstract Windowing Toolkit (AWT) metaphor.

HTML version of Basic Foils prepared 16 May 98

Foil 49 Java Features -- It's Somewhat Interpreted

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java represents a compromise between fully compiled (like C/C++) and fully interpreted (like Smalltalk or Perl) models.
Java "compiler" javac produces a binary bytecode output which is portable and much smaller than the real binary for a specific machine (Typical bytecode size is of order of the original source code, within a factor of 2).
Java "interpreter" executes this bytecode and is therefore less dynamic than e.g. Perl interpreter (which performs an equivalent bytecode construction internally and on-the-fly when reading the program source).
In general, the compilation process is: a) time consuming and b) platform specific. Hence, interpreters are built and used to facilitate a) rapid prototyping and/or b) portability.
Java model is focused on platform independence but the development throughput is also reasonable since the Java compiler is fast and generates compact bytecode output.

HTML version of Basic Foils prepared 16 May 98

Foil 50 Java Features -- It's Distributed and this is a basis for parallelism

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Popular TCP/IP based protocols such as FTP or HTTP are supported in terms of network protocol classes.
  • This implements Java plus message passing and immediately supports various forms of distributed processing.
  • New protocols (e.g. PVM,MPI etc.) can added and dynamically installed.
  • As discussed can build parallel computing on top of these base classes
Distributed computing model of Java is naturally client-server, with Java compiler preparing the bytecodes at the server side, and Java interpreter executing it at the client side.

HTML version of Basic Foils prepared 16 May 98

Foil 51 Java Features -- It's Robust

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java enforces compiler-time and download-time(byte code verifier) type checking and eliminates this way some error prone constructs of C/C++.
Pointer arithmetic is fully eliminated which allows e.g. for runtime checking of array subscripts and enforces security of the Java model.
Explicit declarations are always required, i.e. C-style implicit declarations are abandoned.
  • This allows the Java compiler to perform early error detection.
Rapid prototyping in Java is less natural than in JavaScript,Lisp, Tcl, Smalltalk or Perl, but the software quality assurance of Java is higher than in these more dynamic and 'forgiving' languages.
Note Java can NEVER overwrite itself as types of all arguments and methods are checked

HTML version of Basic Foils prepared 16 May 98

Foil 52 Java Features -- It's (Hopefully) Secure

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java bytecodes are shipped across the network and executed on client machines. Security is therefore a critical issue and strongly enforced in Java.
  • Java contains its own networking classes which are designed to be secure
Modifications of the C++ model such as eliminating pointer arithmetic and coercion were dictated mainly by the security requirements.
Most viruses are based on acquiring access to private/protected sectors of computer memory which is impossible in Java due to all the checks.
Java bytecodes are executed at the client side by Java interpreter which operates exclusively in a restricted memory space.
  • Hence, unless there are security bugs in the Java interpreter itself, the model is safe and users cannot create security holes by incorrectly or maliciously written applets.
The bytecodes sent across network are verified at the client which prevents evil/corrupted classes from causing problems

HTML version of Basic Foils prepared 16 May 98

Foil 53 Java Features -- High Performance

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java interpreter performs on-the-fly runtime execution of the Java bytecodes which results typically in a satisfactory performance.
  • NOT true in initial software which is often 50 times slower than C
  • see http://www.netlib.org/benchmark/linpackjava/
  • performance is improved in new "just-in-time" interpreters, which saves code for repeated sections to provide compiled code efficiency after first execution
  • JIT compilers should be 2 to 4 times slower than classic compiled code
Support for generating native machine code out of Java bytecodes, viewed as intermediate compiler form, is also provided and useful for performance demanding applications.
  • Can "decompile" bytecodes back to Java quite easily
The performance of the machine code, generated directly by native compiler from Java or its bytecodes, should be comparable to that offered by typical Fortran/C/C++ compilers on the same platform.
.

HTML version of Basic Foils prepared 16 May 98

Foil 54 Java Features -- It's Multithreaded

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java model offers preemptive multithreading, implemented in terms of the Thread class. Thread methods offer a set of synchronization primitives based on monitor and conditional variable paradigm by C.A.R. Hoare. Java threads inherit some features from the pioneering Cedar/Mesa System by Xerox Park that gave birth to Macintosh and object-oriented programming.
  • Threads should run in parallel on multi-processor shared memory machines
  • Threads can support full parallel computing on such architectures
A typical use of Java multithreading in applet programming is to have several independent but related simulations (e.g. various sorting algorithms), running concurrently in an applet window.
  • Multithreading is also used internally by the browser to handle multiple document dynamics.
  • I.e. base use is to keep computing while some threads wait on I/O
Java threads don't have built-in point-to-point communication primitives. Various thread communication environments can be provided by coupling the thread and network protocol objects.

HTML version of Basic Foils prepared 16 May 98

Foil 55 Java Features -- It's Dynamic

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Java model is more dynamic than C++ and closer to Smalltalk or Perl.
Subclasses don't need to to be recompiled after superclass implementation is updated.
C++ has "fragile superclass" problem where must recompile children if change anything (method/instance variable) in a superclass or referenced class -- Java resolves references at runtime and avoids this.
Classes have runtime representation (implemented in terms of the Class class) which allows one to look up type of a given object instance at runtime (in C cannot know if pointer is to integer or browser!)
  • JDK1.1 allows introspection to dynamically find out the structure of a class at runtime
  • used for automatic object serialization as when sending over network or saving on disk

HTML version of Basic Foils prepared 16 May 98

Foil 56 Java Books -- I

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
Teach Yourself Java in 21 Days, 2nd ed., by Laura Lemay and Charles L. Perkins, Sams.net Publishing, is a "how-to" book at the intermediate programming level, greatly expanded from the original edition.
Java in a Nutshell, by David Flanagan, is the language reference book in the familiar O'Reilly series. The 2nd edition of this book is now out - it omits many examples from the first edition to make room for large section on JDK 1.1 . Both 1st and 2nd edition are quite useful.
Java, How to Program, by Deitel and Deitel, Prentice-Hall, starts with beginning programming concepts and progresses rapidly through Java language. It has the most programming exercises and also has companion teaching multimedia books.

HTML version of Basic Foils prepared 16 May 98

Foil 57 Java Books -- II

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
The Java Programming Language, by Ken Arnold and James Gosling, Addison-Wesley, May 1996, has lots of details on the language basics for intermediate and advanced programmers. It covers threads and i/o packages, but not applets or windowing packages.
  • All serious computer scientists should read to understand fundamentals
Java Primer Plus, supercharging Web applications with the Java programming language, by Paul M. Tyma, Gabriel Torok, and Troy Downing, Sams.net, doesn't assume a lot of programming background, has chatty explanations and still covers lots of programming detail.

HTML version of Basic Foils prepared 16 May 98

Foil 58 Java Books -- III

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
There are now many books in the Java Series from SunSoft Press, Prentice-Hall. Here are the first five:
  • instant Java, by John A. Pew, contains multimedia and animation applets for HTML authors. This is not a programming book.
  • Java by example, by Jerry R. Jackson and Alan L. McClellan, covers all key features with examples, but not as much detail about the language.
  • just Java, by Peter van der Linden, for intermediate programmers, gives good explanations of key features without going into detail.
  • core Java, by Gary Cornell and Cay S. Horstmann, offers detailed coverage of the language and packages for advanced programmers.
  • graphic Java, by Gary McClellan, gives more details on windowing and user interface and includes new classes (not in originial Java release) for such things as "rubberbanding".

HTML version of Basic Foils prepared 16 May 98

Foil 59 Resources for the Java Programming Language

From Introduction to Java to be used in (Scientific) Computing CEWES Java Tutorial -- Spring Semester 98. *
Full HTML Index
The original resource was the The Java Language Specification by Sun Microsystems, Inc., March 1995 updated to October 1995 but superceded by Gosling and Arnold Book
Most of the books cited earlier have CDROM's with examples and the JDK.
For scientific computing see: http://www.npac.syr.edu/projects/javaforcse/
NPAC has rich set of tutorial material at http://www.npac.syr.edu/projects/tutorials/

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998