Java Platform

This is an old revision of this page, as edited by 65.33.215.211 (talk) at 02:47, 10 April 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Java Platform (computing) is the name for a computing environment from Sun Microsystems which can run applications developed using a standard programming language and set of development tools. In this case, the platform is not a specific hardware or operating system, but rather an execution engine called a virtual machine, and a set of standard libraries which provide common functionality.

The the platform is properly called the Java 2 Platform, and includes both a Standard Edition orJ2SE, an Enterprise Edition or J2EE, and a Micro Edition or J2ME. The current version of the Java 2 platform is alternatively specified as version 1.5 or version 5 (both refer to the same version). A good overview of the myriad of technologies that makes up the Java 2 Platform can be found on the http://java.sun.com/j2se/1.5.0/docs/index.html JDK Documentation Page].

Java Technologies

The Java platform consists of a wide array of technologies, each of which provides a distinct portion of the overall development or runtime environment. For example, end-users typically interace with the Java virtual machine and the standard set of Java Class Libraries. In addition, there are numerous ways for Java applications to be deployed, including being embedded into a web page. Lastly, developers who are creating applications for the platform use a set of development tools called the Java Developers Kit.

Java Runtime

The heart of the Java platform is the concept of a common "virtual" processor that executes machine code that is distinct from the machine code for the physical hardware. For example, a "native" application running on an Intel Pentium processor would use a completely different binary format from a Java application running on the same processor. The Java platform provides an interpreter program, called the Java virtual machine or JVM, that translates the Java bytecode into native binary at run-time. This permits the same application to be run on any platform that has a virtual machine available.

The Java runtime also includes a special program called a just-in-time compiler. This program is capable of converting the Java bytecode into the lower-level native machine code for it's target platform. This process is done as the applications are first loaded into the virtual machine. This step is similar to the process used to create native applications, only delayed until run time. This allows the JIT compiler to target a specific host platform and hardware, even potentially optimizing the output code based on other knowledge of the current host.

When combined with the Java class libraries, the virtual machine and JIT compilers make up the Java Runtime Environment, or JRE.

Java Class Libraries

In most modern operating systems, a large body of reusable code is provided to simplify the programmers job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependant on any specific operating system, applications cannot rely of any of the existing libraries. Instead, the Java platform provides a comprehensive set of standard class libraries, containing much of the same reusable functions commonly found in modern operating systems.

The Java class libraries serve three purposes within the Java platform. Like other standard code libraries, they provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. In addition, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily dependant on the native capabilities of the platform. The Java java.net and java.io libraries implement the required native code internally, then provide a standard interface for the Java applications to perform those tasks. Finally, some underlying platforms may not support all of the features a Java application expects. In these cases, the class libraries can either emulate those features using whatever is available, or provide a consistant way to check for the presence of a specific feature.

User Interfaces

Two of the key sets of class libraries provided by the Java platform are the Abstract Windowing Toolkit, or AWT, and Swing. These libraries provide a consistant user interface for Java applets, regardless of the underlying user interface support. The AWT is the older of the two interface libraries. Applications which use AWT interface components have a consistant look and feel across all platforms that Java supports. By contract, the Swing user interface is designed to mimic the appearance of native applications. For example, an application written using the AWT will look the same on both Windows XP, Windows 2000, and Macintosh OS X. By contract, an application written using Swing will mimic the Windows XP "skinned", Windows 2000 "unskinned", or OS X Aqua look of other applications.

Java Software Developer Kit

The JRE includes only those components needed to run a Java application. The Java Developer Kit, or JDK, also provides the tools needed to build applications. The JDK includes a complete runtime environment, usually called a private runtime, which contains all of the class libraries that will be present in the production environment. It also includes additional libraries that are only used by developers, such as the internationalization libraries and the IDL libraries. Finally, the JDK includes the utility programs that produce a complete application, such as:

  • javac - The Java compiler, which converts source code into Java bytecode
  • jar - The Java archiver, which packages related class libraries into a single file.
  • javadoc - The Java Documentation generator, which scans source code and generates automated documentation.

Java Language

The word Java, by itself, usually refers to the Java programming language which was designed for use with the Java platform. There is room for debate regarding wether or not the language is properly included as part of the Java platform. Programming languages are outside of the scope of the typical sense of the phrase "computing platform". However, Sun Microsystem's includes the programming language as a core part of the Java 2 platform, and the language and runtime are commonly considered a single unit.

The Java language was developed by Sun specifically for use with the Java virtual machine. The syntax is based loosely on C++, though Java is a much more object-oriented language. Programs are written as a collection of classes, with one particular "main" class containing the starting point for the program. The language includes modern programming concepts such as thread synchronization, garbage collection, and structured exception handling. Unlike C++, Java does not support multiple inheritance; instead, it supports the concept of multiple interface implementations.

Other Java Languages

Although the Java language is most often used to build applications for the Java platform, it is not the only such language. Any compiler capable of emitting the proper Java bytecode for use by the JVM can be used to create Java applications.

A few languages have been specifically designed as alternatives to Java, including:

Similar Platforms

Java was not the first virtual-machine-based platform, though it is by far the most successful and well-known. The success of Java and it's write one, run anywhere concept has led to other similar efforts. The most notable of these is the .NET Platform from Microsoft, which borrows many of the concepts and innovations of Java.