BigAdmin System Administration Portal
Feature Article
Print-friendly VersionPrint-friendly Version
Overview of Java Technology on the Solaris Platform

by Eric Rinker

Contents:

Overview

The Java platform is an established enterprise technology that can be found in a range of hardware, from the smallest of cell phones to the largest deployments of Sun Fire 15K servers with 106 UltraSPARC processors. This article provides an introduction to the Java platform for those already well versed in UNIX operating systems like the Solaris Operating Environment and Linux.

Basics of the Java Platform

Launched in 1995, the Java platform promised to simplify developers' lives by providing modern programming language constructs, platform independence, and a standard set of runtime libraries available wherever Java applications are run. True to its network computing roots, the Java applet mechanism allowed the same unmodified code to be downloaded when invoked, and run within a variety of browsers on different operating systems.

Prior to the advent of the Java platform, many popular languages were compiled versus interpreted. Developers wrote source code in languages such as C++, which were compiled into executables specific to particular operating systems and architectures. To get the same application to run on different operating systems, let alone architecture, required a significant software porting effort.

A key to this platform independence is the virtual machine for the Java platform (Java virtual machine or JVM software). Developers compile Java source code into architecturally independent Java byte code, which is then interpreted by the JVM software. The Java virtual machine translates the byte code instructions into OS- and architecture-specific instructions, which the underlying system then runs.

To ensure high performance, Java applications can be tuned at various levels on the stack, including the application, JVM, and underlying system. For example, the Java HotSpot Virtual Machine utilizes just-in-time (JIT) compilation and other technologies to improve performance at the VM level. Also included are runtime flags that can specify memory size, garbage collection algorithms, and other tunable parameters that can improve performance.

The Java runtime environment (JRE) is the software environment that contains the JVM, the Java class libraries, and additional components, including those that ensure security. Within the JRE, all Java applications have to be verified, and the JVM manages common security issues, such as buffer overflows and memory leaks. The JRE also contains the Java Plug-in tool that allows Java applets to run within browsers. Java applets, by default, have restrictions (such as no local file system access) that prevent malicious code from causing damage. However, in trusted environments, Java Web Start software and signed applets allow for greater flexibility.

Editions of the Java Platform

The key to maintaining and troubleshooting Java technology is to know where it is located in the environment and how it interacts. There are three editions of the Java platform, each of which targets specific deployment environments.

Java 2, Standard Edition (J2SE) comes in two flavors: the JRE and the software development kit (SDK). The SDK is a superset of the JRE, which additionally includes development tools and information, such as a Java compiler and IDE. This edition, which comes standard with the Solaris 9 Operating Environment, contains the functionality to run client-side Java applications, such as applets and desktop applications.

Java 2, Enterprise Edition (J2EE) expands on the J2SE platform with technologies to support server-side applications such as JavaServer Pages (JSP), Java Servlets, Enterprise JavaBeans (EJB), and Web services. The J2EE platform has created an entire industry of application servers, such as the Sun ONE Application Server, that implement the J2EE specifications.

Java 2, Micro Edition (J2ME) is a highly optimized Java runtime environment focusing on small computing devices, such as cell phones, PDAs, smart cards, and embedded devices.

Client-Side Java Technology

There are two major ways to use Java technology on the desktop: applets and applications. Web browsers, such as Netscape Software for the Solaris Operating Environment, include J2SE software that can run Java applets by default. As subsequent versions of the J2SE software become available, you can update your browser's ability to use them. You can always verify the version installed on your system, from the command line:

% java -version

Standard with the Solaris 9 Operating Environment, the J2SE software allows you to run Java applications as well. The standard location of the JRE is /usr/java/bin/java. If you had an application, Hello.class, on your directory, you would launch the application like this:

% java Hello

Basically, you are passing the main application class file as an argument to the JRE, dropping the .class extension.

Java Web Start software is designed to give users the power to launch full-featured applications with a single click from a web browser, allowing a corporation to develop and deploy software without manual installs. Java Web Start software delivers a Web Start application to the Web Start engine, which is installed on the client. The Web Start engine checks for updates at each launch. XML-based configuration details for each application are included in .html or .jnlp files. If a newer version of the specific Java Web Start application is available, the Web Start engine will upgrade the application, and then run it. If the client machine has the latest version, the Web Start engine will run the Java application, stored locally, that was acquired in a previous launch. Similar to applets, Java Web Start applications can be upgraded easily throughout an enterprise; the major difference is that a Web Start application does not run as an applet within a browser, and thus has the same access rights to the local system as a local application.

Server-Side Java

Java Servlet technology provides a consistent mechanism for extending the web server's functionality. Servlets serve many roles, from complex computational work and database manipulation to dynamic content generation. A replacement for CGI programs, servlets provide a server and platform-independent method of building web applications that have access to all the benefits of the Java platform.

JSP components provide a workload distribution method to give web content developers the ability to create dynamically generated web pages. JSP pages, which are transformed into Java Servlets at runtime, offer design artists the ability to change the look and feel of a web application with little or no programming experience. This powerful technology allows for delegation of work to specialists, which can improve Internet content development time.

While Java Servlets and JSP pages are generally known as web container applications, Enterprise Java Beans (EJB) technology simplifies multitier application development by means of a flexible business component model, offering capabilities such as distributed transaction management.

Sun ONE Web Server (formerly known as iPlanet Web Server), is a feature-rich HTTP/HTTPS server with built-in support for web container applications, such as JSP pages and Java Servlets. Sun ONE Application Server contains similar functionality, along with EJB and Web services technologies. It also has sophisticated management and availability features, such as fail-over capabilities, needed for enterprise environments.

Installation

Solaris OE
The installation process for the Java platform is designed to be as painless as possible. To install the Java platform on the Solaris OE, first you need to install the appropriate patch cluster for the operating environment in question.

Afterwards, download the JRE/SDK and install it. For a step-by-step guide, follow these install instructions. The instructions are for v1.4.1, but can be applied to most versions. Note: If 64-bit support is required, the 32-bit packages must be installed first.

  1. Java 1.1 and Java 1.2 are installed in /usr/java<version> directories.
  2. The default Java version used by the system is referenced by the /usr/java link.
  3. Java 2 installs into /usr/j2se<version>. It should not be referenced by /usr/java, as older applications could fail trying to use j2se. Instead, the Java version you use should be the first instance found in the path variable.

Linux
Installing Java technology under a Linux platform may require some upgrading, as older OS versions may not have the correct version of glibc or libstdc++. RedHat Linux received most testing efforts, but other platforms such as Caldera or SuSE have also been proven to run Java technology. For known problems, check out Sun's install instructions.

Windows
Installing on Windows is a simple process. Download and run the executable provided, following the instructions provided by the installer. The latest service pack may be required.

Tuning and Optimization

A more in-depth knowledge of Java technology can be gained through the Java Tutorial.

Performance tuning is a tricky and complex blend of balancing feature needs with application speeds. The following articles, web sites, and books can help you in your quest.

Sun Sites

Other Resources

March 2003

 

Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.

 
BigAdmin