Java platform: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Pat Palmer
mNo edit summary
 
(34 intermediate revisions by 7 users not shown)
Line 1: Line 1:
The '''Java platform''' is a bundle of interdependent programs required to create and run programs using the [[Java_programming_language|Java programming language]].  Sun began work on the platform in 1992 and formally launched the programming language in 1995, after which its use grew rapidly across the computer industry.  As of December 2006, the Java platform (Standard Edition) was in its 6th major revision (version 6.0).  
{{subpages}}
The '''Java platform''' is a bundle of interdependent programs required to create and run programs using the [[Java_programming_language|Java programming language]].  Sun began work on the platform in 1992 and formally launched the programming language in 1995, after which its use grew rapidly across the computer industry.  There are three different editions of the Java platform:<ref>{{cite web
| url=http://www.sun.com/software/opensource/java/project_overview.jsp
| title= Open-Source Java Project Overview
| accessdate=2007-04-08
}}</ref>
#Java Standard Edition, called Java SE<ref name="JavaSE">{{cite web|url=http://java.sun.com/javase/|title="Java SE at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=[[Sun]]|year=2007|accessdate=2007-09-22}}</ref> (formerly J2SE) for desktop machines
#the Java Enterprise Edition, called Java EE<ref name="JavaEE">{{cite web|url=http://java.sun.com/javaee/|title="Java EE at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=[[Sun]]|year=2007|
accessdate=2007-09-22}}</ref> (formerly J2EE) for web and application servers; a superset of the SE
#the Java Micro Edition, called Java ME<ref name="JavaME">{{cite web|url=http://java.sun.com/javame/|title="Java ME at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=[[Sun]]|year=2007|
accessdate=2007-09-22}}</ref> (formerly J2ME) for hand-held devices such as smart phones.  The language is a subset of the Standard Edition language, while the libraries (packages) are mostly a subset of the Standard Edition, plus a few libraries to support a simpler GUI. As the Micro Edition GUI can be implemented on top of the Standard Edition GUI, if appropriate libraries are installed, Micro Edition applications can be run in the Standard Edition.
 
As of December 2006, the Java platform (Standard Edition) was in its 6th major revision (version 6.0).


==How the platform works==  
==How the platform works==  
The Java platform's centerpiece is an execution engine, also known as the [[Virtualization|virtual machine]] or [[runtime environment]], that has been implemented for most [[operating system]]s, including Windows, Linux, Unix and Mac OS X.  As well, thousands of pre-written Java library classes, also called ''base classes'', are available on each operating system.  The Java runtime environment (JRE) and the Java class libraries make all computers look alike so that programs written in the [[Java programming language]] can run identically on all of them.
The Java platform's centerpiece is an execution engine, also known as the [[Virtualization|virtual machine]] or [[runtime environment]], that has been implemented for most [[operating system]]s. The Standard Edition JVM has been implemented on [[Windows]], [[Linux]], [[Unix]] and [[Mac OS X]].  The Enterprise Edition can run on top of any Standard Edition JVM.  The Micro Edition JVM has been implemented on Palm OS, Windows Mobile, and many mobile phones.  As well, thousands of pre-written Java library classes, also called ''base classes'', are available on each operating system.  The Java runtime environment (JRE) and the Java class libraries make all computers look alike so that programs written in the [[Java programming language]] can run identically on all of them. Optional packages for the Standard Edition include packages for e-mail sending and retrieving, 3D graphics, video, sound, and Bluetooth.  Optional packages for the Micro Edition include Bluetooth, Video, Web Serivces and database connection.


[[Image:Java diagram.png|thumb|300px|right|Java's runtime environment hides the underlying operating system from the programmer]]
{{Image|Java diagram.png|right|250px|Java's runtime environment hides the underlying operating system from the programmer}}
The platform consists of multiple programs, each of which provides a distinct portion of its overall capabilities.  The essential components in the platform are the Java [[source code]] [[compiler]], the [[Java class libraries]], and the [[Java runtime environment]].  The Java [[source code]] [[compiler]] converts Java [[source code]] (files with an extension of .java) into [[Java bytecode]] (files with an extension of .class).  The runtime environment is a special program that takes as input Java intermediate bytecode (.class files) for ''execution'' according to the rules laid out in the ''Java<sup>TM</sup> Virtual Machine Specification, Second Edition''<ref name="JVMspec2">{{cite web|url=http://java.sun.com/docs/books/jvms/|title="The Java Virtual Machine Specification, Second Edition" Copyright © 1997-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303 U.S.A.  All Rights Reserved.|publisher=[[Sun Microsystems, Inc.]]|year=1999|accessdate=2007-08-24}}</ref>.
The platform consists of multiple programs, each of which provides a distinct portion of its overall capabilities.  The essential components in the platform are the Java [[source code]] [[compiler]], the [[Java class libraries]], and the [[Java runtime environment]].  The Java [[source code]] [[compiler]] converts Java [[source code]] (files with an extension of .java) into [[Java bytecode]] (files with an extension of .class).  The runtime environment is a special program that takes as input Java intermediate bytecode (.class files) for ''execution'' according to the rules laid out in the ''Java<sup>TM</sup> Virtual Machine Specification, Second Edition''<ref name="JVMspec2">{{cite web|url=http://java.sun.com/docs/books/jvms/|title="The Java Virtual Machine Specification, Second Edition" Copyright © 1997-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303 U.S.A.  All Rights Reserved.|publisher=[[Sun Microsystems, Inc.]]|year=1999|accessdate=2007-08-24}}</ref>.


Line 15: Line 27:


The Java platform also includes extensive libraries (pre-compiled into Java bytecode) containing reusable code, as well as numerous ways for Java applications to be deployed, including being embedded in a web page as an applet, on a desktop machine for a single user, on a web server as a ''servlet'' (returning "dynamic" information to web browsers), or on a web server as a [[web service]] endpoint (procedure callable across a network from any kind of platform).  There are [http://java.sun.com/javase/6/docs/ several other components] as well.
The Java platform also includes extensive libraries (pre-compiled into Java bytecode) containing reusable code, as well as numerous ways for Java applications to be deployed, including being embedded in a web page as an applet, on a desktop machine for a single user, on a web server as a ''servlet'' (returning "dynamic" information to web browsers), or on a web server as a [[web service]] endpoint (procedure callable across a network from any kind of platform).  There are [http://java.sun.com/javase/6/docs/ several other components] as well.
==Editions==
Java programs may execute as ''applications'' on a desktop, on a web server as part of ''web applications'', or as ''applets'' in a browser (where they are restricted from changing the file system).  Java is thus delivered in one of three bundle types:<ref>{{cite web
| url=http://www.sun.com/software/opensource/java/project_overview.jsp
| title= Open-Source Java Project Overview
| accessdate=2007-04-08
}}</ref>
#Java Standard Edition or [[Java SE]] (formerly J2SE) for desktop machines
#the Java Enterprise Edition or [[Java EE]] (formerly J2EE) for web servers
#the Java Micro Edition or [[Java ME]] (formerly J2ME) for hand-held devices such as smart phones.
Furthermore, when downloading Java, users must select either the Java Runtime Edition (JRE) or Java Development Kit (JDK) version.  The JRE contains only the runtime (virtual machine) and pre-compiled libraries.  The JDK also contains the Java source code compiler and other utilities needed by programmers when developing Java programs.
===Versions===
*1.0
*1.1
*1.2
*1.3
*1.4
*5.0 - Java version 1.5 adheres to the ''Java Language Specification, 3rd Edition''<ref name="JavaSpec3">{{cite web|url=http://java.sun.com/docs/books/jls/|title="The Java Language Specification, Third Edition" Copyright © 1996-2005 Sun Microsystems, Inc.4150 Network Circle, Santa Clara, California 95054 U.S.A.All rights reserved.|publisher=[[Sun Microsystems, Inc.]]|year=2005|accessdate=2007-08-24}}</ref>.
*6.0


===Associated file extensions===
===Associated file extensions===
Line 43: Line 34:
** .jar files may contain byte codes, resources such as images, metadata, and they may even contain source code
** .jar files may contain byte codes, resources such as images, metadata, and they may even contain source code
** To view and separate the contents of a .jar file, make a copy of it and rename the copy to have a .zip extension.  Then open it like any .zip file.
** To view and separate the contents of a .jar file, make a copy of it and rename the copy to have a .zip extension.  Then open it like any .zip file.
*when people say "component" or library, they usually mean a .jar file that does not have an entry point--it has methods that we can call, but it doesn't run "standalone"
*when people say "component" or library, they usually mean a .jar file that does not have an entry point it has methods that we can call, but it doesn't run "standalone"
*''Enterprise'' Java (on a web server) uses two additional file archive extensions: .war and .ear .  A .war file can be used to install a ''web application'' into a servlet container (a Java Virtual Machine, or runtime, that collaborates with a web server).  An .ear file is used to install and encapsulate Enterprise Java Beans.
*''Enterprise'' Java (on a web server) uses two additional file archive extensions: .war and .ear .  A .war file can be used to install a ''web application'' into a servlet container (a Java Virtual Machine, or runtime, that collaborates with a web server).  An .ear file is used to install and encapsulate Enterprise Java Beans.


==Competition with C# and the .NET platform==
==Download Choices==
In 2000, Microsoft introduced the .NET framework, a new platform with a Java-like language ([[C sharp|C#]]) and associated development tools.  The Java platform and the .NET framework have been competing vigorously on the desktop, but especially in the area of server technology.  Many [[software developer]]s (programmers) become expert on one or the other, but few have time to learn both.  The schism of understanding the two platforms has been widened due to misinformation and disinformation, with a fair amount of zealotry on the part of each system's defenders.
When downloading Java, users must select their current operating system, and then choose either the Java Runtime Edition (JRE) or Java Development Kit (JDK) version.  The JRE contains only the runtime (virtual machine) and pre-compiled libraries; this is all that is needed to run Java programs on a given operating system.  The JDK also contains the Java source code compiler and other utilities needed by programmers when developing Java programs.


From a historical viewpoint, the two systems may be seen as having different goals. A primary goal for Java was to enable a program to run on several different operating systems; this was accomplished by providing implementations of the Java virtual machine for all prevalent [[operating system|operating systems]], including members of the Unix family, Linux, Max OS X and most versions of Windows.
==Java SE Platform Releases==
*1.0 - Released in 1996, the original Java SE had quite a few deficiencies.
*1.1 - Released in 1997, Java SE version 1.1 was greatly revised and improved.
*1.2 - Released in 1998 and known as Java ''version 2'', it introduced the [[Swing]] library for graphical [[user interface design]]
*1.3 - Released in 2000, Java SE ''version 3'' had no new syntax but introduced new libraries.
*1.4 - Released in 2002, Java SE ''version 4'' introduced the Java [[assert statement]].
*5.0 - Released in 2004, Java SE ''version 5''<ref name="JavaSpec3">{{cite web|url=http://java.sun.com/docs/books/jls/|title="The Java Language Specification, Third Edition" Copyright © 1996-2005 Sun Microsystems, Inc.4150 Network Circle, Santa Clara, California 95054 U.S.A.All rights reserved.|publisher=[[Sun Microsystems, Inc.]]|year=2005|accessdate=2007-08-24}}</ref> introduced quite a bit of new syntax, including generics.
*6.0 - Released in 2006.


Microsoft has been widely criticized for only implementing its .NET runtime "only on Windows." Such criticism does not take into account that Windows is not a single operating system (at least not from the viewpoint of a programmer who must call routines in the operating system).  Even before Microsoft Vista appeared in 2007, there were already approximately 35 versions of Windows, all with slightly different application programming interfaces (API's).  The difficulty of developing software for these many different Windows systems had led to a situation called "DLL Hell", where the wrong versions of dynamic link libraries (DLL's) were encountered by programs trying to run.  Creating the .NET framework solved this huge problem for Microsoft by making all versions of Windows alike to programmers. 
==Java EE Platform Releases==


In fact, some .NET programs can run on non-Windows platformsMiguel de Icaza (co-creator of [[GNOME]]) has created an [[open source]] implementation of the .NET framework for Unix-like operating systems; it runs on [[Mac OS X]], [[Linux]] and [[Sun Microsystems|Sun's]] [[Solaris]]).  Called [[Mono]], this independent implementation of a "common language runtime" is based on .NET's ECMA/ISO standards<ref name="Mono Project Main page">{{cite web| url=http://www.mono-project.com/Main_Page | title="Mono Project Main page" | date=Retrieved 2007-04-25}}</ref> and is not under the jurisdiction or ownership of Microsoft.
==Java ME Platform Releases==
Micro Edition applications are targeted for a '''configuration''' and '''profile'''Current combinations include
* Connected Limited Device Configuration (CLDC) and Mobile Information Device Profile (MIDP)
* Connected Device Configuration (CDC) and Personal Basic Profile
* Connected Device Configuration (CDC) and Personal Profile
The CLDC is targeted for less powerful devices such as "feature phone" mobile phones, while the CDC is targeted for more powerful devices, such as PDAs, "smartphones" and TV set top boxes. However, almost all devices currently use the CLDC.


The .NET framework and the Java platform have diverged in various other ways, including that .NET was designed to allow many different programming languages to use its runtime and libraries (whereas the Java platform was not used fpr multiple languages until very recently)There was no theoretical reason for Java being the only language that initially used the Java runtimeIt was only since perhaps 2006, in response to Microsoft's multi-language .NET strategy, that Sun finally began a push to get additional languages  "targeting" the Java runtime.
The CLDC 1.0/MIDP 1.0 were criticized by programmers for being a lowest-common-denominator approach.  Notably absent were access to the device's address book, datebook and to-do list, which is important for many mobile applications. It was difficult to write a non-trivial application that had the ease-of-use of native applications.  This and other reasons lead mobile phone manufacturers to provide non-standard libraries (packages) to provide more direct access to system resources.  Applications which use these non-standard libraries are not portable to other Micro Edition devicesThe market for Micro Edition applications is thus "fragmented" -- divided into device- or manufacturer-specific groupsCurrently, significant Mobile Edition Java applications that are "write-once, run anywhere" are uncommon.


===Platform comparison===
The CLDC 1.1/MIDP 2.0 provided significant new functionality, and optional libraries give access to the address book, datebook, to-do list and other features such as Bluetooth.  As of 2008, this has not yet triggered a convergence of Mobile Edition applications.


<ul>
At the 2007 JavaOne Conference, James Gosling (the father of Java, and a Vice President of Sun Microsystems, the biggest corporate supporter of Java) stated that he foresees Standard Edition replacing Micro Edition in mobile devices, as they grow more powerful. He acknowledges this convergence will probably take many years.
<li>Java was the model
for Microsoft when it created C# in 2002<ul>
<li>Java and C# code look very similar; it is fairly easy to switch
between the two</li>
</ul>
</li><li>Java is cross-platform; .NET is cross-language:<ul>
<li>Java provides freedom from <i>all</i> OS differences, by making
necessary cross-platform compromises; Java does
    <b>not</b> provide cross-<i>language</i> calling</li>
<li>.NET makes 36 versions of Windows alike for programmers; it eliminates the "DLL hell" which formerly
occurred when installing Windows applications</li>
<li>.NET libraries can be used by any of the .NET compiled languages (of
which there are dozens); libraries can be written in any .NET language</li>
</ul>
</li><li>the two platforms compete fiercely in the world wide web<ul>
<li>JSP's require Apache web servers (Linux or Unix); these are HTML
interlaced with code</li>
<li>&nbsp;&nbsp;&nbsp; called "servlets" if all code</li>
<li>ASP's require
Microsoft's IIS6 web server; these are HTML interlaced with code</li>
<li>&nbsp;&nbsp;&nbsp; called "web handlers" if all code</li>
<li>both Linux and Microsoft web servers use load-balancing across mirrored web
farms to scale up</li>
<li>so-called "dynamic" languages such as Ruby are seen by
some as the next stage beyond Java and .NET</li>
</ul></li>
<li>it's an arms race!</li>
</ul>


==External Links==
==Competition with [[C sharp|C#]] and the [[.NET Framework]]==
* [http://java.sun.com/docs/white/langenv/index.html The Java Language Environment], a white paper by [[James Gosling]] and [[Henry McGilton]], two of the original developers of Java
See a [[Comparison of Java and .NET]].


==References==
==References==
<references />
{{reflist}}[[Category:Suggestion Bot Tag]]
 
[[Category:CZ Live]]
[[Category:Computers Workgroup]]

Latest revision as of 11:01, 4 September 2024

This article is developing and not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

The Java platform is a bundle of interdependent programs required to create and run programs using the Java programming language. Sun began work on the platform in 1992 and formally launched the programming language in 1995, after which its use grew rapidly across the computer industry. There are three different editions of the Java platform:[1]

  1. Java Standard Edition, called Java SE[2] (formerly J2SE) for desktop machines
  2. the Java Enterprise Edition, called Java EE[3] (formerly J2EE) for web and application servers; a superset of the SE
  3. the Java Micro Edition, called Java ME[4] (formerly J2ME) for hand-held devices such as smart phones. The language is a subset of the Standard Edition language, while the libraries (packages) are mostly a subset of the Standard Edition, plus a few libraries to support a simpler GUI. As the Micro Edition GUI can be implemented on top of the Standard Edition GUI, if appropriate libraries are installed, Micro Edition applications can be run in the Standard Edition.

As of December 2006, the Java platform (Standard Edition) was in its 6th major revision (version 6.0).

How the platform works

The Java platform's centerpiece is an execution engine, also known as the virtual machine or runtime environment, that has been implemented for most operating systems. The Standard Edition JVM has been implemented on Windows, Linux, Unix and Mac OS X. The Enterprise Edition can run on top of any Standard Edition JVM. The Micro Edition JVM has been implemented on Palm OS, Windows Mobile, and many mobile phones. As well, thousands of pre-written Java library classes, also called base classes, are available on each operating system. The Java runtime environment (JRE) and the Java class libraries make all computers look alike so that programs written in the Java programming language can run identically on all of them. Optional packages for the Standard Edition include packages for e-mail sending and retrieving, 3D graphics, video, sound, and Bluetooth. Optional packages for the Micro Edition include Bluetooth, Video, Web Serivces and database connection.

Java's runtime environment hides the underlying operating system from the programmer

The platform consists of multiple programs, each of which provides a distinct portion of its overall capabilities. The essential components in the platform are the Java source code compiler, the Java class libraries, and the Java runtime environment. The Java source code compiler converts Java source code (files with an extension of .java) into Java bytecode (files with an extension of .class). The runtime environment is a special program that takes as input Java intermediate bytecode (.class files) for execution according to the rules laid out in the JavaTM Virtual Machine Specification, Second Edition[5].

The Java platform does not necessarily include an integrated development environment (IDE), although there is a Java runtime environment bundle available from Sun that includes the free NetBeans IDE. Several other free IDE's exist, including the widely used, free Eclipse IDE (which is open-source and can be used for several other languages besides Java).

Bytecode and JIT compilation

JITcompilation.jpg

Java bytecode is an intermediate language; Java bytecode programs are loaded and run by a Java Virtual Machine (JVM), also known as a Java Runtime Environment (JRE). JREs tend to be sophisticated; most of them implement the JVM specification by means of a just-in-time (JIT) compiler that, at runtime, converts intermediate bytecode into native machine code. JIT compilation occurs on a per method basis only the first time each method is called, after which the native code for that method remains cached in memory; this means that subsequent executions of that method run as fast as native programs. Java programs tend to "warm up" after they have been executing for awhile, and in some cases they execute as efficiently as native code after an initial startup period.

The Java platform also includes extensive libraries (pre-compiled into Java bytecode) containing reusable code, as well as numerous ways for Java applications to be deployed, including being embedded in a web page as an applet, on a desktop machine for a single user, on a web server as a servlet (returning "dynamic" information to web browsers), or on a web server as a web service endpoint (procedure callable across a network from any kind of platform). There are several other components as well.

Associated file extensions

  • Java source files have an extension of .java
  • Java bytecode files (also called class files) have an extension of .class
  • Java executable programs have an extension of .jar (Java ARchive); they must be loaded at runtime by a Java Runtime Environement (JRE)
    • .jar files may contain byte codes, resources such as images, metadata, and they may even contain source code
    • To view and separate the contents of a .jar file, make a copy of it and rename the copy to have a .zip extension. Then open it like any .zip file.
  • when people say "component" or library, they usually mean a .jar file that does not have an entry point — it has methods that we can call, but it doesn't run "standalone"
  • Enterprise Java (on a web server) uses two additional file archive extensions: .war and .ear . A .war file can be used to install a web application into a servlet container (a Java Virtual Machine, or runtime, that collaborates with a web server). An .ear file is used to install and encapsulate Enterprise Java Beans.

Download Choices

When downloading Java, users must select their current operating system, and then choose either the Java Runtime Edition (JRE) or Java Development Kit (JDK) version. The JRE contains only the runtime (virtual machine) and pre-compiled libraries; this is all that is needed to run Java programs on a given operating system. The JDK also contains the Java source code compiler and other utilities needed by programmers when developing Java programs.

Java SE Platform Releases

  • 1.0 - Released in 1996, the original Java SE had quite a few deficiencies.
  • 1.1 - Released in 1997, Java SE version 1.1 was greatly revised and improved.
  • 1.2 - Released in 1998 and known as Java version 2, it introduced the Swing library for graphical user interface design
  • 1.3 - Released in 2000, Java SE version 3 had no new syntax but introduced new libraries.
  • 1.4 - Released in 2002, Java SE version 4 introduced the Java assert statement.
  • 5.0 - Released in 2004, Java SE version 5[6] introduced quite a bit of new syntax, including generics.
  • 6.0 - Released in 2006.

Java EE Platform Releases

Java ME Platform Releases

Micro Edition applications are targeted for a configuration and profile. Current combinations include

  • Connected Limited Device Configuration (CLDC) and Mobile Information Device Profile (MIDP)
  • Connected Device Configuration (CDC) and Personal Basic Profile
  • Connected Device Configuration (CDC) and Personal Profile

The CLDC is targeted for less powerful devices such as "feature phone" mobile phones, while the CDC is targeted for more powerful devices, such as PDAs, "smartphones" and TV set top boxes. However, almost all devices currently use the CLDC.

The CLDC 1.0/MIDP 1.0 were criticized by programmers for being a lowest-common-denominator approach. Notably absent were access to the device's address book, datebook and to-do list, which is important for many mobile applications. It was difficult to write a non-trivial application that had the ease-of-use of native applications. This and other reasons lead mobile phone manufacturers to provide non-standard libraries (packages) to provide more direct access to system resources. Applications which use these non-standard libraries are not portable to other Micro Edition devices. The market for Micro Edition applications is thus "fragmented" -- divided into device- or manufacturer-specific groups. Currently, significant Mobile Edition Java applications that are "write-once, run anywhere" are uncommon.

The CLDC 1.1/MIDP 2.0 provided significant new functionality, and optional libraries give access to the address book, datebook, to-do list and other features such as Bluetooth. As of 2008, this has not yet triggered a convergence of Mobile Edition applications.

At the 2007 JavaOne Conference, James Gosling (the father of Java, and a Vice President of Sun Microsystems, the biggest corporate supporter of Java) stated that he foresees Standard Edition replacing Micro Edition in mobile devices, as they grow more powerful. He acknowledges this convergence will probably take many years.

Competition with C# and the .NET Framework

See a Comparison of Java and .NET.

References