Java Platform: Difference between revisions

Content deleted Content added
Kutulu (talk | contribs)
Combine sections on JRE, and on Languages. Move details on UI and the JDK to their respective articles.
Line 3:
The the platform is properly called the '''Java 2 Platform''', and includes both a Standard Edition or [[J2SE]], 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 Technologiestechnologies ==
 
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 [[Javaclass Class Libraries]]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 Development Kit]].
 
== Java Runtime Environment ==
A program targeting the Java platform needs two components to be present on its host: a Java virtual machine, and a set of class libraries providing any services on which it depends. Sun's distribution of their JVM and their implementation of the standard classes is known as the Java Runtime Environment (JRE).
 
=== Java Virtual Machine ===
The heart of the Java platform is the concept of a common "virtual" processor that executes machineJava code[[bytecode]] thatprograms. isThis distinctbytecode fromis the machinesame codeno formatter the physicalwhat hardware. or Foroperating example,system athe "native"program applicationis running on an Intel Pentium processor would use a completely different binary format from a Java application running on the same processorunder. The Java platform provides an [[interpreter (computing)|interpreter]] program, called the [[Java virtual machine]] or (JVM), thatwhich translates the Java bytecode into native binaryprocessor instructions at run-time. This permits the same application to be run on any platform that has a virtual machine available.
 
TheSince JavaJRE runtimeversion also1.2, includesSun's aJVM specialimplementation programhas also calledincluded a [[just-in-time compilation|just-in-time compiler]] compiler. Instead Thisof programinterpreting isthe capablebytecode ofone convertinginstruction theat Javaa [[bytecode]]time, intothis converts the lower-level native machine codebytecode for it'sa targetprogram platform.into equivalent Thisnative processmachine is donecode as the applicationsprogram are firstis loaded into the virtual machine., causing Thisit stepto isexecute similarmuch tofaster at the processcost usedof toa createsmall nativedelay applications,whenever onlynew delayedbytecode untilis run timeloaded. This allows the JIT compiler to target a specific host platform and hardware, even potentially optimizing the output code in different ways based on other knowledgeobservations of the currentprogram's hostbehaviour.
 
Java was not the first virtual-machine-based platform, though it is by far the most successful and well-known. Previous uses for virtual machine technology primarily involved [[emulators]] to aid development platforms for not-yet-developed hardware or operating systems, properlybut calledthe [[Simulation#Simulation_in_computer_science|simulator]]s.JVM was Thedesigned successto ofbe Javaimplemented andentirely it'sin [[write oncesoftware, runwhile anywhere]]making conceptit has also ledeasy to otherefficently similarport efforts.an implementation Theto most notablehardware of these is the [[Microsoft .NET]] platform, which borrows many of the concepts and innovations ofall Javakinds.
When combined with the Java class libraries, the virtual machine and JIT compilers make up the [[Java Runtime Environment]], or JRE.
 
== Java Class Libraries ==
 
== Java= Class Librarieslibraries ===
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 InterfacesLanguages ==
 
The word Java, by itself, usually refers to the [[Java programming language]] which was designed for use with the Java platform. There isProgramming roomlanguages forare debatetypically regardingoutside wether or notof the language is properly included as partscope of the Javaphrase "platform". ProgrammingHowever, languagesSun aredoes outsidenot ofencourage the scopeuse of theany typicalother senselanguages ofwith the phrase "computing platform". However, Sunand Microsystem's includeslists the Java programming language as a core part of the Java 2 platform,. and theThe language and runtime are therefore commonly considered a single unit.
Two of the key sets of class libraries provided by the Java platform are the [[Abstract Windowing Toolkit]], or AWT, and [[Swing (Java)|Swing]]. These two libraries make up the [[Java Foundation Classes]], the standard set of user interface tools for Java applications. They 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, and was heavily criticized as little more than a wrapper around the native graphical capabilities of the host platform. That meant that the standard [[widget (computing)|widget]]s in the AWT relied on those capabilities of the native widgets, requiring the developer to also be aware of the differences between host platforms. An alternative graphics library called the Internet Foundation Classes was developed by [[Netscape Communications Corporation]], which was implemented in platform independant code. Ultimately, Sun merged the IFC with other technologies under the name '''Swing''', adding the capability for a pluggable [[look and feel]] of the widgets. This allows Swing to maintain it's platform independant code base, but mimic the look of a native application.
 
Nevertheless, third parties have produced a number of compilers which target the JVM. Some of these are for existing languages, while others are for extensions to the Java language itself. These include:
== Java Development 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 (computer science)|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:
 
* [[Groovy]]
* [[Pizza programming language|Pizza]]
* [[GJ]] (Generic Java), which was incorporated into official Java as of Sun's version 1.5.
* [[GJ]]
* [[NetREXX]]
 
== Similar Platforms ==
The success of Java and it's [[write once, run anywhere]] concept has also led to other similar efforts. The most notable of these is the [[Microsoft .NET]] platform, which borrows many of the concepts and innovations of Java.
 
Java was not the first virtual-machine-based platform, though it is by far the most successful and well-known. Previous uses for virtual machine technology primarily involved development platforms for not-yet-developed hardware or operating systems, properly called [[Simulation#Simulation_in_computer_science|simulator]]s. The success of Java and it's [[write once, run anywhere]] concept has also led to other similar efforts. The most notable of these is the [[Microsoft .NET]] platform, which borrows many of the concepts and innovations of Java.
 
[[Category:Java platform]]