Full HTML for

Basic foilset Introduction to Java Tutorial Aimed at Scientific Users

Given by Geoffrey C. Fox at NAVO Tutorial on Sept 23 1998. Foils prepared Sept 21 1998
Outside Index Summary of Material


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

Table of Contents for full HTML of Introduction to Java Tutorial Aimed at Scientific Users

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient
denotes presence of Additional linked information which is greyed out if missing

1 Java for Scientific Computing Introduction to Java Tutorial
2 Abstract of Introduction to Java for CSE Tutorial
3 What is Java and What is Good For? for Foil 3 What and Why is Java in a Nutshell?
4 Why is Java worth looking at for Scientific Computing?
5 Why use the Web as basis for HPCC/Scientific Computing Software?
6 The Computing Pyramid
7 Implications of the Computing Pyramid
8 Java Applications and Applets and their use from HTML
9 HotJava Browser Architecture of Java Applets
10 Architecture of Java Applications
11 Java Applications in a Nutshell
12 The HelloWorld Application for Foil 12 The Simplest Java Application: Hello,World!
13 Java Applets
14 Two ways to run a Java applet
15 The HelloWorld Applet for Foil 15 The Simplest Java Applet: Hello, World!
16 title=The HelloWorldApplet.html file Displaying your applet from a Web page.
17 More Details on Applet Tags - I
18 More Details on Applet Tags - II
19 <param> Tags and Applets
20 The Java Language Environment Java vs. JavaScript
21 General Discussion of Role of Java in Scientific and other Computing Applications
22 Computing Services at 3 levels
23 There are (at least) 3 Major Roles for JAVA in Computation -- i.e. it has a role at each layer
24 The 3 Roles of Java
25 Overall Features of Java and Associated Enterprises
26 History of Java Language and Team
27 History of Java Language and Team until Dec. 95
28 More Recent Java History
29 Some Key Java Features and Philosophy
30 Java Features -- It's Simple and Familiar!
31 Java Features -- It's Object-oriented
32 Java Features -- It's Architecture-Neutral
33 Java Features -- It's Portable
34 Java Features -- It's Somewhat Interpreted
35 Java Features -- It's Distributed (and can support parallel computing)
36 Java Features -- It's Robust
37 Java Features -- It's (Hopefully) Secure
38 Java Features -- High Performance
39 Java Features -- It's Multithreaded
40 Java Features -- It's Dynamic
41 The Java Language Compared Sun's Comparison of Language Features
42 Java Development Kit 1.1 JDK 1.1
43 JDK 1.2
44 Java Web Servers for Foil 44 Java Web Servers
45 Java Text Books for Foil 45 Java Books -- I
46 Java Books -- II
47 Java Beta Books -- III
48 Java Resources for Foil 48 Resources for the Java Programming Language
49 Java Grande Forum Motivation and Activities
50 What is Java Grande?
51 What is Goal of Java Grande Forum?
52 Activities of the Java Grande Forum I
53 Gosling on Operator Overloading
54 Activities of the Java Grande Forum II
55 Java as a Scientific Programming Language Sequential -- Parallel Interpreted -- Compiled
56 Java and Parallelism?
57 "Pure" Java Model For Parallelism
58 Java -- Interpreters and Compilers
59 Hierarchy of Software Levels
60 MPI Java + Message Passing

Outside Index Summary of Material



HTML version of Basic Foils prepared Sept 21 1998

Foil 1 Java for Scientific Computing Introduction to Java Tutorial

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Geoffrey Fox
Nancy McCracken
Syracuse University
NPAC
111 College Place Syracuse NY 13244 4100

HTML version of Basic Foils prepared Sept 21 1998

Foil 2 Abstract of Introduction to Java for CSE Tutorial

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Introduction to Applications and Applets
The 3 uses of Java in computing
The 3-tier web-based computing model
History of Java Development
Overall Java Philosophy and Features including security etc.
Java for parallel computing
Performance of Java

HTML version of Basic Foils prepared Sept 21 1998

Foil 3 What and Why is Java in a Nutshell?

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index What is Java and What is Good For? for Foil 3
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
  • 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 Sept 21 1998

Foil 4 Why is Java worth looking at for Scientific Computing?

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
The Java Language has several good design features
  • secure, safe (wrt bugs), object-oriented, familiar (to C C++ and even Fortran programmers)
Java has a very good set of libraries covering everything from commerce, multimedia, images to math functions (under development at http://math.nist.gov/javanumerics)
Java has best available electronic and paper training and support resources
Java is rapidly getting best integrated program development environments
Java naturally integrated with network and universal machine supports powerful "write once-run anywhere" model
There is a large and growing trained labor force
Can we exploit this in computational science?

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 6 The Computing Pyramid

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 7 Implications of the Computing Pyramid

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Web Software MUST be cheaper and better than MPP software as factor of 100 more money invested!
Therefore natural strategy is to get parallel computing environment by adding synchronization of parallel algorithms to loosely coupled Web distributed computing model

HTML version of Basic Foils prepared Sept 21 1998

Foil 8 Java Applications and Applets and their use from HTML

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index

HTML version of Basic Foils prepared Sept 21 1998

Foil 9 Architecture of Java Applets

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index HotJava Browser
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.
web server
Java code
is compiled
to produce
applet codes,
part of web
document
collection
web client, running browser
such as Netscape or IE
executes (restricted)
applet code to display
in browser window
Internet

HTML version of Basic Foils prepared Sept 21 1998

Foil 10 Architecture of Java Applications

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java applications are compiled and run on a machine just like any other general programming language such as C/C++. No web server or network are required although Java applications may also use network connections for distributed computing.
Java code
is compiled
to produce
bytecodes
run by Java
interpreter
to produce
results
OR
Java code
is compiled
to produce
native code
run directly
on machine
for better
performance

HTML version of Basic Foils prepared Sept 21 1998

Foil 11 Java Applications in a Nutshell

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
All Java programs are written into a file with a ".java" extension.
Applications are .java files with a main method which is excuted first.
How to compile and run a Java application (via bytecodes):
  • Run the compiler on a .java file:
  • javac MyProgram.java
  • producing a file "MyProgram.class" of Java 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 Sept 21 1998

Foil 12 The Simplest Java Application: Hello,World!

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index The HelloWorld Application for Foil 12
Since Java is object-oriented, programs are organized into modules called classes, which may have data in variables and subroutines called methods.
class HelloWorld
{ public static void main (String[] args)
{ System.out.println("Hello World!");
}
}
Each program is enclosed in a class definition.
main() is the first method that is run.
The notation class.method or package.class.method is how to refer to a public method (with some exceptions).
Syntax is similar to C - braces for blocks, semicolon after each statement. One difference: upper and lower case matter!

HTML version of Basic Foils prepared Sept 21 1998

Foil 13 Java Applets

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 init, start, paint etc. for displaying on the browser window
The applet should be run through javac compiler getting a .class file as before: javac MyApplet.java
The resulting file MyApplet.class is then stored in the document collection of a web server (hence has a URL location).
Also create an HTML file (say MyApplet.html) with an applet tag to MyApplet.class.
  • <APPLET codebase="http://myserver.org/mydirectory"
  • code = "MyApplet.class" width=300 height=100>

HTML version of Basic Foils prepared Sept 21 1998

Foil 14 Two ways to run a Java applet

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Run Netscape 2.0 or later or Internet Explorer essentially anywhere, point the browser at MyApplet.html, and applet is downloaded from the webserver 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.
Or, primarily for debugging purposes, if you have JDK on your machine, you can run the applet with a program called the appletviewer:
  • appletviewer MyApplet.html
This way we can compile on places with JDK installed but run almost anywhere!

HTML version of Basic Foils prepared Sept 21 1998

Foil 15 The Simplest Java Applet: Hello, World!

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index The HelloWorld Applet for Foil 15
Java applets are part of the class hierarchy that can call methods to display on a screen (within the browser window). One way to draw on the screen is to call the method drawString from the standard method paint.
import java.awt.Graphics;
public class HelloApplet extends java.applet.Applet
{ public void paint (Graphics g)
{ g.drawString("Hello World!", 5, 25);
}
}
The import statement (similar to an include) allows the use of methods from the Graphics class .
The paint method displays a graphics object on the screen - one of the standard methods that takes the place of main for applets.
Puts this as a subclass of Applet.

HTML version of Basic Foils prepared Sept 21 1998

Foil 16 Displaying your applet from a Web page.

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index title=The HelloWorldApplet.html file
You should name the file with your applet name, HelloWorldApplet.java, run the compiler (javac), getting a bytecode file HelloWorldApplet.class, which you put in a web directory.
<html><head>
<title>Simple Hello Page</title>
</head>
<body>
My Java applet says:
<applet code="HelloWorldApplet.class" width=150 height=25>
</applet>
</body></html>
Name of your applet class.
The browser will use a rectangle of width 150 pixels and height 25 pixels to display the applet within the other html.

HTML version of Basic Foils prepared Sept 21 1998

Foil 17 More Details on Applet Tags - I

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 18 More Details on Applet Tags - II

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 19 <param> Tags and Applets

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 20 Java vs. JavaScript

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index The Java Language Environment
Despite the word "java" in the name, JavaScript is a different language than Java, albeit with some similarities.
A JavaScript program is written directly into the HTML page, and is executed by the JavaScript intrepeter, so also executes dynamic web page content in the browser window.
JavaScript is special purpose - it is an object-based language that deals directly with browser entities such as windows, textfields, forms, frames and documents.
JavaScript can respond to browser events (not as many as Java's more complex capabilities with the user interface) such as mouse clicks and user-typed text.
JavaScript is easy and fast to write, but not as powerful as Java.

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index

HTML version of Basic Foils prepared Sept 21 1998

Foil 22 Computing Services at 3 levels

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java for the Graphical User Interface and client side analysis systems, including visualization: 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 Sept 21 1998

Foil 24 The 3 Roles of Java

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index

HTML version of Basic Foils prepared Sept 21 1998

Foil 25 Overall Features of Java and Associated Enterprises

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index

HTML version of Basic Foils prepared Sept 21 1998

Foil 26 History of Java Language and Team

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 (~30 people, now Java Team) continues development and decides to adapt Oak as a Web technology.

HTML version of Basic Foils prepared Sept 21 1998

Foil 27 History of Java Language and Team until Dec. 95

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 28 More Recent Java History

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
1996 JavaOne Developer's Conference (now held annually in June) focused on applets.
1997 JavaOne focused on JavaBeans and new version of the language JDK1.1, both designed to put Java in line with other developments in component and secure distributed web object computing and use of databases.
1998 JavaOne featured attendance of 14,000+ and focused on Enterprise JavaBeans and other Enterprise classes, developing more on server-side applications.

HTML version of Basic Foils prepared Sept 21 1998

Foil 29 Some Key Java Features and Philosophy

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
First we discuss original Java base language features as discussed in 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
Finally we mention additional features added to Java in more recent versions.

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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.
It also results in a much smaller kernel which is suitable for planned Java ports to consumer electronic devices. Base (alpha) interpreter is ~40Kb, libraries and threads add additional 175Kb.

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 (some 250 public classes were released in both alpha and beta).
Java class plays also a role of a communication atom in the Web embedding model. Applet classes identify themselves by names in the HTML applet tag. Applet downloads other classes, present in the applet source. Hence, the Java class names play the role of addressing mode for the distributed Java code database.

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 opcode).
Java compiler (written in Java and platform-independent) reads Java source and generates Java bytecode. These bytecodes are shipped to client machines upon browser requests.
Each client machine must run Java interpreter which performs runtime execution of Java bytecodes. Java interpreter is written in POSIX compliant ANSI C and needs to be ported to and conventionally compiled (once) on each individual platform.
Once the interpreter is ported, application developers don't need to worry at all about platform specificity and differences between native compilers.

HTML version of Basic Foils prepared Sept 21 1998

Foil 33 Java Features -- It's Portable

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java language offers a uniform abstract (virtual) machine model which is identical for all platforms.
SUN owns the Java Virtual Machine (see online report) -- 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
Differences between vendor specific windowing environments (X Windows, MS Windows, Macintosh) are removed in terms of the Abstract Windowing Toolkit (AWT) metaphor.
AWT is given by ~60 Java classes (alpha) which offer a universal GUI programming model, portable between UNIX, PC and Mac, and translated automatically to native windowing systems on individual platforms by Java interpreters.

HTML version of Basic Foils prepared Sept 21 1998

Foil 34 Java Features -- It's Somewhat Interpreted

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java represents a compromise between fully compiled (like C/C++) and fully interpreted (like Smalltalk or Perl) models.
Java "compiler" 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 Sept 21 1998

Foil 35 Java Features -- It's Distributed (and can support parallel computing)

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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, such as PVM and MPI, can be added and dynamically installed.
  • Parallel computing can be built on top of these base classes.
Distributed computing model of Java is mainly client-server, with Java compiler preparing the opcodes at the server side, and Java interpreter executing it at the client side.

HTML version of Basic Foils prepared Sept 21 1998

Foil 36 Java Features -- It's Robust

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java enforces compiler-time 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 complier 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.

HTML version of Basic Foils prepared Sept 21 1998

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

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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.
Java opcodes are executed at the client side by Java interpreter which operates exclusively on the virtual memory. 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 Sept 21 1998

Foil 38 Java Features -- High Performance

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 100 times slower than C
  • performance is improved in new "just-in-time" interpreters, which saves code for repeated sections to provide compiled code efficiency after first execution
Support for generating native machine code out of Java bytecodes, viewed as intermediate compiler form, is also provided and useful for performance demanding applications.
The performance of the machine code, generated from Java bytecodes, is comparable to that offered by typical C/C++ compilers on the same platform.
Several of these concepts are in fact similar as in the OSF/ANDF project. Using ANDF terminology, we would call Java compiler a 'producer', and the machine code generator discussed here, an 'installer'. Default Java working mode doesn't use installers but directly interprets the intermediate form (this mode is supported in ANDF by GAI -- Generalized ANDF Interpreter).
Java/HotJava system implements ANDF concepts for the Java language.

HTML version of Basic Foils prepared Sept 21 1998

Foil 39 Java Features -- It's Multithreaded

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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.
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.
Another interesting application domain are multi-HotJava environments to come such as collaboratory or gaming.
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 Sept 21 1998

Foil 40 Java Features -- It's Dynamic

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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!)

HTML version of Basic Foils prepared Sept 21 1998

Foil 41 Sun's Comparison of Language Features

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index The Java Language Compared
Good Fair Poor
Java Smalltalk TCL Perl Shells C C++
Performance
Simple
Object-Oriented
Robust
Secure
Interpreted
Dynamic
Portable
Neutral
Threads
GarbageCollection
Exceptions

HTML version of Basic Foils prepared Sept 21 1998

Foil 42 JDK 1.1

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index Java Development Kit 1.1
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.
Netscape4.0 and Internet Explorer 4.0 do support JDK 1.1, on some platforms you must explicitly download the "AWT" version to get all of 1.1 support.
Features: better event model in the AWT, Java Database Connectivity (JDBC), Remote Method Interface (RMI), internationalization, security certificates and encryption, and JavaBeans.
http://www.javasoft.com/products/jdk/1.1

HTML version of Basic Foils prepared Sept 21 1998

Foil 43 JDK 1.2

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
This newly released version of Java has additional classes.
It is not currently supported in final release browsers.
It features classes for the "Swing Set", which is many new user interface elements with a more sophisticated look and feel, drag and drop, text editors, printing formatted text, 2D and 3D geometry, image processing and more multimedia classes.

HTML version of Basic Foils prepared Sept 21 1998

Foil 44 Java Web Servers

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index Java Web Servers for Foil 44
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 Sept 21 1998

Foil 45 Java Books -- I

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index Java Text Books for Foil 45
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 - currently best book reference. Also Java Examples in a Nutshell.
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 Sept 21 1998

Foil 46 Java Books -- II

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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, concentrates on object-oriented and distributed computing aspects of Java.

HTML version of Basic Foils prepared Sept 21 1998

Foil 47 Java Beta Books -- III

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
There are now many books in the Java Series from SunSoft Press, Prentice-Hall.
  • core Java, by Gary Cornell and Cay S. Horstmann, offers detailed coverage of the whole language and packages for advanced programmers. Also Volume 2 gives good coverage of advanced topics such as JDBC, RMI, JavaBeans and security.
  • graphic Java, by Gary McClellan, gives more details on windowing and user interface and includes new classes (not in original Java release) for such things as "rubberbanding".
There are also titles that specifically cover more advanced topics. Here is one:
  • advanced Java networking, by Prashant Sridharan has chapters on JDBC, RMI, CORBA, JavaBeans and security.

HTML version of Basic Foils prepared Sept 21 1998

Foil 48 Resources for the Java Programming Language

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index Java Resources for Foil 48
The original resource was The Java Language Specification by Sun Microsystems, Inc., March 1995 updated to October 1995 but superceded by Gosling and Arnold Book
http://www.javasoft.com web site has plenty of references including
Most of the books cited earlier have CDROM's with examples and the JDK.

HTML version of Basic Foils prepared Sept 21 1998

Foil 49 Java Grande Forum Motivation and Activities

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
http://www.javagrande.org

HTML version of Basic Foils prepared Sept 21 1998

Foil 50 What is Java Grande?

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Use of Java for:
High Performance Network Computing
Scientific and Engineering Computation
(Distributed) Modeling and Simulation
Parallel and Distributed Computing
Data Intensive Computing
Communication and Computing Intensive Commercial and Academic Applications
HPCC Computational Grids ........
Very difficult to find a "conventional name" that doesn't get misunderstood by some community!

HTML version of Basic Foils prepared Sept 21 1998

Foil 51 What is Goal of Java Grande Forum?

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java has potential to be a better environment for "Grande application development" than any previous languages such as Fortran and C++
The Forum Goal is to develop community consensus and recommendations for either changes to Java or establishment of standards (frameworks) for "Grande" libraries and services
These Language changes or frameworks are designed to realize "best ever Grande programming environment"
First Meeting Mar 1 Palo Alto at Java 98 -- 200 Attendees set Agenda -- 30 permanent people and further meetings May 9-10, Aug 6-7
Public Discussion SC98 Orlando November 13 (3 hour panel)
http://www.npac.syr.edu/projects/javaforcse

HTML version of Basic Foils prepared Sept 21 1998

Foil 52 Activities of the Java Grande Forum I

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Two major working groups promoting standards and community actions
Numerics: Java as a language for mathematics led by Ron Boisvert and Roldan Pozo from NIST
  • Changes in Java controversial handling of floating point which currently has goal of reproducible results but this leads to non optimal accuracy
  • Addition of Complex types or classes
  • Lightweight classes and Operator overloading -- enables implementation of complex as a class
  • "Fortran rectangular multidimensional arrays" -- Java naturally has "arrays of arrays"
  • High quality math libraries with agreed interfaces -- FFT, Matrices, Transcendental functions

HTML version of Basic Foils prepared Sept 21 1998

Foil 53 Gosling on Operator Overloading

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Java Grande 98 Feb 28 98

HTML version of Basic Foils prepared Sept 21 1998

Foil 54 Activities of the Java Grande Forum II

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Distributed and Parallel Computing led by Dennis Gannon and Denis Caromel (INRIA, France)
  • Performance of RMI (Attractive Java distributed object model - "remote method invocation")
  • Performance of Java runtime (the virtual machine VM) with lots of threads, I/O, memory use
  • Parallel Computing interfaces including Java MPI binding
  • Development of universal (condor, Globus, Legion UNICORE WebSubmit ..) Java interface to computing resources -- enables seamless computing (easier than metacomputing!)
Development of Grande Application benchmarks

HTML version of Basic Foils prepared Sept 21 1998

Foil 55 Java as a Scientific Programming Language Sequential -- Parallel Interpreted -- Compiled

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Note Java will have same performance as Fortran
a)when Industry compilers mature b)if Sun accepts Java Grande recommendations

HTML version of Basic Foils prepared Sept 21 1998

Foil 56 Java and Parallelism?

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 NPAC's 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 (standard Java Runtime) does not support distributed memory systems

HTML version of Basic Foils prepared Sept 21 1998

Foil 57 "Pure" Java Model For Parallelism

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 58 Java -- Interpreters and Compilers

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
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 Sept 21 1998

Foil 59 Hierarchy of Software Levels

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Numerical Objects in (C++/Fortran/C/Java)
Expose the Coarse Grain Parallelism
Expose All Levels of Memory Hierarchy
a) Pure Script (Interpreted)
c) High Level Language but Optimized Compilation
d) Machine Optimized RunTime
b) Semi- Interpreted
a la Applets
Memory Levels in High
Performance CPU
Nodes of Parallel/ Distributed System

HTML version of Basic Foils prepared Sept 21 1998

Foil 60 MPI Java + Message Passing

From Introduction to Java Tutorial Aimed at Scientific Users NAVO Tutorial -- Sept 23 1998. *
Full HTML Index
Naturally one can implement an MPI linkage for Java and this has been implemented by NPAC (mpiJava) Mississippi State and Westminister College (London)
There is no formal definition of Java binding to MPI ad there are some areas of uncertainity
Westminister version automatically links C version of MPI to Java Native Interface (JNI)
NPAC version "optimizes" Java link based on C++ MPI standard noting Java does not support "memory sequence" but with serialization could allow transfer of objects http://www.npac.syr.edu/projects/pcrc/mpiJava
MSU version goes one step further with a version even more tuned to Java

© 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 Apr 11 1999