Personal tools
You are here: Home Information Systems Java Platform Introduction 2. The Java Technology

2. The Java Technology

Document Actions
  • Send this
  • Print this
  • Content View
  • Bookmarks

The Java Technology

<-- Previous

Table of Contents

Next -->

Java, or more correctly the Java technology, is both a programming language and a platform. According to Sun (2003), the proprietors of the Java technology, Java is a high-level programming language that aims to be characterised by the following:

With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java bytecodes - the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java bytecode instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.


(java.sun.com, 2003)

You can think of Java bytecodes as the machine code instructions for the Java Virtual Machine (Java VM™). Every Java interpreter, whether it's a development tool or a Web browser that can run applets, is an implementation of the Java VM.

Java bytecodes help make "write once, run anywhere" possible. You can compile your program into bytecodes on any platform that has a Java compiler. The bytecodes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, Windows XP, a Solaris workstation, or on an iMac.

The Java Platform

A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Windows XP, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:

  • The Java Virtual Machine (Java VM)
  • The Java Application Programming Interface (Java API)

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.

The following figure depicts a program that's running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware.


(java.sun.com, 2003)

Native code is code that after compilation runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring Java performance close to that of native code without threatening portability. (java.sun.com, 2003)

<-- Previous

Table of Contents

Next -->

 

Copyright 2007-2008, by the Contributing Authors. Cite/attribute Resource. 2. The Java Technology. (2008, July 16). Retrieved May 21, 2013, from UWC Free Courseware Web site: http://freecourseware.uwc.ac.za/freecourseware/information-systems/java-platform-introduction/the-java-technology. All Rights Reserved.