|
 About Java |
|
|
|
|
Understanding the Java Platform Architecture
The Java platform is unique in that it's a software-only platform that runs on top of other
hardware-based platforms. Hence, the Java Platform lets you develop and deploy Java applications
on desktops and servers, as
well as today's demanding embedded and
real-time environments. Java
also includes classes that support the development of web services
and provides the foundation for enterprise development.
At an empirical level, the Java Platform consists of three elements:
- The Java Programming Language—The Java programming language is syntactically similar to C++,
but differs in execution. While C++ uses unsafe pointers and programmers are responsible for allocating and
freeing memory, the Java programming language uses type-safe object references, and unused memory is reclaimed
automatically. Furthermore, the Java programming language eschews multiple inheritance—a likely source of
confusion and ambiguity in C++—in favor of a cleaner construct, interfaces.
- The Java Virtual Machine—The Java virtual machine forms the foundation of the Java platform. This architecture offers several attractive features: The virtual machine can be implemented to run a top a variety of operating systems and hardware, with binary-compatible Java applications operating consistently across many implementations. In addition, the virtual machine provides tight control of executed binaries, enabling safe execution of untrusted code.
- The Java APIs—An extensive set of standard application programming interfaces (APIs) rounds out the Java platform. These support almost everything you might want your applications to do, from user interface design to cryptography, from CORBA connectivity to internationalization.
Taken together, the Java language, Java virtual machine, and Java APIs compose the Java platform. However, the following features and tools are also available for Java developers:
- NetBeans—NetBeans is a free and open source Java development environment for Java ME, Java SE, and Java EE technology-based applications. Several plug-in modules with Java technology sources are available to help developers get started learning about the core Java platforms. NetBeans is available on Windows, Linux, MacOS, as well as Solaris.
- Javadoc—Javadoc is a tool for generating API documentation in HTML format from documentation comments in source code.
- Deployment Technologies—The JDK software provides standard mechanisms such as the Java Web Start software and Java Plug-In software for deploying your applications to end users.
- User Interface Toolkits—The Java Foundation Classes (JFC), including the Swing and Java 2D toolkits, make it possible to create sophisticated Graphical User Interfaces (GUIs) for Java applications.
- Integration Libraries—Integration libraries such as the Java IDL API, JDBCTM API, Java Naming and Directory Interface (JNDI) API, Java RMI, and Java Remote Method Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology) enable database access and manipulation of remote objects.
Currently, the Java platform comes in three flavors:
- Java Platform, Standard Edition (Java SE) is designed for desktop computers. Most often it runs on top of Sun Solaris, Mac OS X, Linux, or Microsoft Windows.
- Java Platform, Enterprise Edition (Java
EE)is a comprehensive platform for multi-user, enterprise-wide applications. It is based on Java SE and adds APIs for Internet-based server-side computing.
- Java Platform, Micro Edition (Java ME) is a set of technologies and specifications developed for small devices like pagers, mobile phones, and set-top boxes. Java ME uses smaller-footprint subsets of Java SE components, such as smaller virtual machines and leaner APIs, and defines a number of APIs that are specifically targeted at consumer and embedded devices.
Specifications for Java SE, Java EE, and Java ME are developed under the aegis of the
Java Community Process (JCP). A Java specification begins life as a Java Specification Request (JSR). An expert group consisting of representatives from participating companies is formed to create the specification. The JSR then passes through various stages in the JCP before it is finalized. There are currently more than 300 JSR and both companies and individuals can join the JCP.
The work of the Java Community under the JCP's procedures helps to ensure Java technology's standard of stability and cross-platform compatibility, enabling it to operate on hundreds of millions of devices, from servers to desktop computers to consumer electronics to industrial robots. Just as important, the JCP continually grows the platform's specification portfolio to meet the emerging technology needs of developers and organizations globally who depend on Java technology.
Let's take a look at each of the editions in more detail.
The Java Platform, Standard Edition (Java SE)
The Java technologies and application programming interfaces (APIs) are shown in Figure 1 are the foundation of the Java Platform, Standard Edition (Java SE). They provide all you need to create server applications, desktop applications, and applets that run on almost every popular operating system.

Figure 1: The Java SE Platform
As shown in the figure, there are two principal products in the Java SE platform family:
Java SE Runtime Environment (JRE) and
Java SE Development Kit (JDK). Complimenting these
products is the Java SE API.
- Java Runtime Environment (JRE)—The JRE provides the Java APIs, Java virtual machine, and other components necessary to run applets and applications written in the Java programming language. It is also the foundation for the technologies in the Java Platform, Enterprise Edition (Java EE). Note that the JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.
- Java Development Kit (JDK)—The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications. The conceptual diagram illustrates all the component technologies in Java SE platform and how they fit together.
The Java SE application programming interface (API) defines the manner by which an applet or application can make requests to and use the functionality available in the compiled Java SE class libraries. The Java SE class libraries are also part of the Java SE platform. The most commonly used Java APIs are shown in Table 1.
|
|
java.io |
Provides for system input and output through data streams, serialization and the file system. |
java.lang |
Provides classes that are fundamental to the design of the Java programming language. |
java.net |
Provides the classes for implementing networking applications. |
java.nio |
Defines buffers, which are containers for data, and provides an overview of the other NIO packages. |
java.security |
Provides the classes and interfaces for the security framework. |
java.text |
Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages. |
java.util |
Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array). |
java.util.concurrent |
Utility classes commonly useful in concurrent programming. |
|
In addition, Table 2 shows some of the more popular tools and extension APIs in the Java SE platform.
|
|
|
Java Cryptography Extension (JCE) |
JCE is a set of packages that provides a framework and implementations for encryption, key generation and key agreement, and Message Authentication Code (MAC) algorithms. Support for encryption includes symmetric, asymmetric, block, and stream ciphers. The software also supports secure streams and sealed objects. |
|
Java Foundation Classes (JFC) |
JFC are a set of GUI components and other services simplifying the development and deployment of desktop and Internet/Intranet applications. The JFC are a superset that contains AWT. JFC extends AWT by adding many components and services. JFC consists of Swing, Java 2D, AWT, Accessibility, and the Drag-and-Drop APIs. |
|
Java Native Interface (JNI) |
JNI is the native programming interface for Java that is part of the JDK. The JNI allows Java code to operate with applications and libraries written in other languages, such as C, C++, and assembly. Recommended only for advanced programmers. |
|
Java Web Start |
Using Java Web Start technology, standalone Java software applications can be deployed with a single click over the network. Java Web Start ensures the most current version of the application will be deployed, as well as the correct version of the Java Runtime Environment (JRE). |
|
Javadoc Tool |
The Javadoc tool is used to generate API documentation in HTML format from doc comments in source code. It can be downloaded only as part of the JDK download. |
|
JDBC |
JDBC is a Java API for executing SQL statements. By using the JDBC API, you can access almost any data source, from relational databases to spreadsheets to flat files. Java SE includes the JDBC API. |
|
RMI |
RMI lets Java applications communicate across a network. The communicating applications can be running on different computers on opposite sides of the planet. This higher-level and method-based approach to network communications allows access to a remote object as easily as a local object. |
|
|
The Java Platform, Enterprise Edition (Java EE)
The Java Platform, Enterprise Edition begins with the Java programming language and the Java virtual machine.
Java EE then defines an architecture for implementing services through the use of a Java EE server as multi-tier applications
that deliver the scalability, accessibility, and manageability needed by enterprise-level applications. This model partitions the work
needed to implement a multi-tier service into two parts: the business and presentation logic to be implemented by the developer, and
the standard system services provided by the Java EE platform. The developer can rely on the platform to provide solutions for the hard
systems-level problems of developing a multi-tier service.
The Java EE platform uses a distributed multi-tiered application model for enterprise applications. Application logic is divided into components according to function, and the various application components are installed on different machines depending on the tier to which the application component belongs. Figure 2 shows two multi-tiered Java EE applications divided into the following tiers.
- Client-tier components run on the client machine.
- Web-tier components run on the Java EE server.
- Business-tier components run on the Java EE server.
- Enterprise information system (EIS)-tier software, such as one or more databases, runs on the EIS server.
Although a Java EE application can consist of the three or four tiers shown in Figure 2, Java EE multi-tiered applications are generally considered to be three-tiered applications because they are distributed over three locations: client machines, the Java EE server machine, and the database or legacy machines at the back-end. Three-tiered applications that run in this way extend the standard two-tiered client and server model by placing a multi-threaded application server between the client application and back-end storage.

Figure 2: Multitiered Applications in the Java EE Platform
Java EE Components
Java EE applications are made up of components. A Java EE component is a self-contained functional software unit that is assembled into a Java EE application with its related classes and files and that communicates with other components. The Java EE specification defines the following Java EE components:
- Application clients and web clients are components that run on the client.
- ava Servlet, JavaServer Faces, and JavaServer Pages (JSP) technology components are web components that run on the Java EE server.
- Enterprise JavaBeans (EJB) components (enterprise beans) are business components that run on the Java EE server.
Java EE components are written in the Java programming language and are compiled in the same way as any program in the Java language. The difference between Java EE components and "standard" Java classes is that Java EE components are assembled into a Java EE application, are verified to be in compliance with the Java EE specification, and are deployed to production, where they are run and managed by a Java EE server.
Java EE Clients
A Java EE client can be a web client or an application client.
- Web Clients—A web client consists of two parts: (1) dynamic web pages containing various types of markup language (HTML, XML, and so on), which are generated by web components running in the web tier, and (2) a web browser, which renders the pages received from the server. A web client is sometimes called a thin client. Thin clients usually do not query databases, execute complex business rules, or connect to legacy applications. When you use a thin client, such heavyweight operations are off-loaded to enterprise beans executing on the Java EE server, where they can leverage the security, speed, services, and reliability of Java EE server-side technologies.
- Application Clients—An application client runs on a client machine and provides a way for users to handle tasks that require a richer user interface than can be provided by a markup language. It typically has a graphical user interface (GUI) created from the Swing or the Abstract Window Toolkit (AWT) API, but a command-line interface is certainly possible. Application clients directly access enterprise beans running in the business tier. However, if application requirements warrant it, an application client can open an HTTP connection to establish communication with a servlet running in the web tier. Application clients written in languages other than Java can interact with Java EE 5 servers, enabling the Java EE 5 platform to interoperate with legacy systems, clients, and non-Java languages.
The Java Platform, Micro Edition (Java ME)
The Java Platform, Micro Edition (Java ME) is a combination of technologies and specifications used to create a complete Java runtime environment for a particular range of devices and target markets. Each combination is optimized for the memory, processing power, and I/O capabilities of a related category of devices. The result is a common Java platform that takes full advantage of each type of device to deliver a rich user experience.
Java ME is divided into configurations, profiles and optional packages.
- Configurations—Configurations are specifications that detail a virtual machine and a base set of class libraries which provide the necessary APIs that can be used with a certain class of device. They provide the low-level functionality for a particular range of devices that share similar characteristics, such as network connectivity and memory footprint. A configuration, for example, might be designed for devices that have less than 512 KB of memory and an intermittent network connection. The virtual machine is either a full Java Virtual Machine (JVM), as described in the specificationÑor some subset of the full JVM. The set of APIs is customarily a subset of the Java SE APIs. Currently, there are two Java ME configurations: the Connected Limited Device Configuration (CLDC) and the Connected
Device Configuration (CDC).
- Profiles—Profiles complement a configuration by adding more specific APIs to make a complete runtime environment for running applications in a specific device category. A profile is a set of higher-level APIs that further define the application life-cycle model, the user interface, persistent storage and access to device-specific properties. A widely adopted example is to combine CLDC with the Mobile Information Device Profile (MIDP) to provide a complete Java application environment for mobile phones and other devices with similar capabilities.
- Optional Packages—Optional packages extend the Java ME platform by adding functionality to the technology stack that includes either CLDC or CDC and an associated profile(s). Created to address very specific application requirements, optional packages offer standard APIs for using both existing and emerging technologies such as database connectivity, wireless messaging, multimedia, 3D graphics, and Web Services. Because optional packages are modular, device manufacturers can avoid carrying the overhead of unnecessary functionality by including only the packages that an application actually needs. Optional packages can be implemented alongside virtually any combination of configurations and profiles.
The current relationship between Java ME configurations, profiles and optional packages is shown in Figure 3.

Figure 3: The Java ME Platform
As the diagram shows, Java ME has two base configurations.
- Connected, Limited Device Configuration (CLDC)—The first is the Connected, Limited Device Configuration (CLDC). This configuration is for small wireless devices with intermittent network connections, like mobile phones, and personal digital assistants (PDAs). The Mobile Information Device Profile (MIDP), which is based on CLDC, was the first finished profile and thus the first finished Java ME application environment. MIDP-compliant devices are widely available worldwide.
- Connected Device Configuration (CDC)—The other base configuration is the Connected Device Configuration (CDC). This configuration is for larger devices (in terms of memory and processing power) with robust network connections. Set-top boxes, Internet appliances, and embedded servers are good examples of CDC devices, although high-end mobile devices also fit this configuration well. The Foundation Profile extends CDC and serves as the basis for several other profiles. It provides core APIs shared with Java SE, including classes and interfaces from
java.lang, java.io, java.security, java.util, and more.
NetBeans IDE and Sun Development Tools with OpenJDK
The NetBeans Integrated Development Environment (IDE) is a wonderful tool that developers can use to experiment with the newly open-sourced Java platform. In fact, the open source components recently announced by Sun have already been configured as NetBeans projects. Developers can download the source code, open it in the NetBeans IDE, and use the Build Project command to build it. For further information, and a step-by-step tutorial, see the
OpenJDK page on Netbeans.org.
In addition, an application developer project is available as part of the Mobile and Embedded community, with links to resources such as the NetBeans Mobility Pack, the Java ME authoring tool that delivers a whole new level of sophistication and ease for drag-and-drop screen design. Sun Microsystems is also making available the world-record producing Sun Studio development environment for the development of the platform-specific native code in the Java HotSpot virtual machine.
The recently announced NetBeans 5.5 contains a variety of new features, including: Java Persistence API and JAX WS 2.0 productivity tools, Subversion support, and enhancements to the NetBeans GUI Builder (formerly known as Project Matisse). NetBeans 5.5 is the first and only freely available IDE to provide comprehensive support for Java EE 5, the industry standard for developing portable, robust, scalable, and secure server-side Java applications.
The initial pieces of Sun's Java Development Kit have been open sourced on java.net. The rest of the JDK will be open sourced over the next few months. Since Sun contributes heavily to the NetBeans IDE it is natural that these projects should work closely together. So far three parts of the JDK have been open sourced - Hotspot, JavaHelp and Javac. Since NetBeans is a development tool, the java compiler (javac) is of particular interest. JavaHelp, in turn, is used by NetBeans as the help system. See the OpenJDK link above for information on how to get the java compiler sources.
For More Information
The OpenJDK page
The OpenJDK page on Netbeans.org
In addition, most of the information in this document has been compiled from the following sources:
New To Java Center—This collection of links to articles, tutorials, online books, and software downloads helps you find what you need to start writing applications.
The Java Tutorial—This book explains how Java technology is both a programming language and a platform, and provide an overview of what this technology can do for you.
The
J2EE Tutorial—This is an excellent tutorial to get a grasp on the myriad technologies that make up the Java Platform, Enterprise Edition.
Introduction to the Java ME Platform—This document helps you to familiarize yourself with the Java ME platform's many rich, powerful features.
|
$1M Community Innovation Awards
Sun Sponsors Open Source Community

|