Java platform: Difference between revisions
imported>Eric M Gearhart (cranked the px size down on the image to make it more readable at 1024x768) |
imported>Andrey Khalyavin |
||
Line 33: | Line 33: | ||
** .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 | *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. | ||
Revision as of 03:15, 6 May 2008
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]
- Java Standard Edition, called Java SE[2] (formerly J2SE) for desktop machines
- the Java Enterprise Edition, called Java EE[3] (formerly J2EE) for web servers; a superset of the SE
- the Java Micro Edition, called Java ME[4] (formerly J2ME) for hand-held devices such as smart phones.
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, 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 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
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
Competition with C# and the .NET Framework
See a Comparison of Java and .NET.
References
- ↑ Open-Source Java Project Overview. Retrieved on 2007-04-08.
- ↑ "Java SE at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=Sun (2007). Retrieved on 2007-09-22.
- ↑ "Java EE at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=Sun (2007). Retrieved on 2007-09-22.
- ↑ "Java ME at a Glance" Copyright 1994-2007 Sun Microsystems, Inc.publisher=Sun (2007). Retrieved on 2007-09-22.
- ↑ "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.. Sun Microsystems, Inc. (1999). Retrieved on 2007-08-24.
- ↑ "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.. Sun Microsystems, Inc. (2005). Retrieved on 2007-08-24.