Java on Solaris 7 Developer's Guide

Chapter 1 Introduction

This Developer's Guide describes features of and information about application development using Java in the Solaris 2.6 and Solaris 7 environments.


Note -

For important information about this release of Java on Solaris software, refer to

http://www.sun.com/solaris/java/


Java And The Java Runtime Environment (JRE)

This section describes basic information about Java and the JRE.

Java

Java is a recently-developed, concurrent, class-based, object-oriented programming and runtime environment, comprised of:

Java has the following characteristics:

JRE

The JRE is the software environment in which programs compiled for a typical JVM implementation can run. The runtime system includes:

This figure shows the JRE and its components, including a typical JVM implementation's various modules and its functional position with respect to the JRE and class libraries.

Figure 1-1 Typical JVM's Implementation: Functional Relationship to JRE and Class Libraries

Graphic

JVM

The JVM is an abstract computing machine, having an instruction set and using memory. Virtual machines are often used to implement a programming language. The JVM is the cornerstone of the Java programming language. It is responsible for Java's cross-platform portability and the small size of its compiled code.

The Solaris JVM is used to execute Java applications. The Java compiler, javac, outputs bytecodes and puts them into a .class file. The JVM then interprets these bytecodes, which can then be executed by any JVM implementation, thus providing Java's cross-platform portability. The next two figures illustrate the traditional compile-time environment and the new portable Java compile-time environment.

Figure 1-2 Traditional Compile-Time Environment

Graphic

Figure 1-3 New Portable Java Compile-Time Environment

Graphic

The MT JVM

The Java programming language requires that MT programs be supported. All Java interpreters provide an MT programming environment. However, many of these interpreters support only uniprocessor multithreading, so Java program threads are executed only one at a time.

The Solaris JVM interpreter takes full advantage of multiprocessor systems by using the intrinsic Solaris multithread facilities. These allow multiple threads of a single process to be scheduled simultaneously onto multiple CPUs. An MT Java program run under the Solaris JVM will have a substantial increase in concurrency over the same program run on other platforms.

The Sun Just-In-Time(JIT) Compiler

The Sun Java JIT compiler, an integral part of the Solaris JVM, can accelerate execution performance many times over previous levels. Long-running, compute-intensive programs show the best performance improvement.

The JIT Compile Process

When the JIT compiler environment variable is on (the default), the JVM reads the .class file for interpretation and passes it to the JIT compiler. The JIT compiler then compiles the bytecodes into native code for the platform on which it is running. The next figure illustrates the JIT compile process.

Figure 1-4 JIT Compile Process

Graphic

The following figure shows the functional relationship of the JIT to the Solaris JVM and JRE.

Figure 1-5 Solaris JVM Functional Relationship to the JIT Compiler

Graphic