JDK 1.1 for Solaris Developer's Guide

Chapter 1 Introduction to the Java Programming Environment

This developer's guide describes features of and information about application development using Java in the Solaris 2.6, Solaris 7, and Solaris 8 environments.

Note -

For important information about this release of Java on Solaris software, refer to www.sun.com/solaris/java/.

Java Programming Environment and the Java Runtime Environment (JRE)

This section describes basic information about Java and the JRE.

What is the Java Programming Environment?

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

Java has the following characteristics:

JRE Components

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

The following 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



The JVM is an abstract computing machine, having an instruction set that uses 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


Figure 1-3 New Portable Java Compile-Time Environment


Multithreading JVM

The Java programming language requires that multithreading (MT) programs be supported (see Chapter 2, Multithreading). All Java interpreters provide an MT programming environment. However, many of these interpreters support only uniprocessor multithreading, so Java program threads are executed 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.

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.

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


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