Usuario discusión:Aviguille/Java (Sun)

Contenido de la página no disponible en otros idiomas.
De Wikipedia, la enciclopedia libre

Java refers to a number of products and specifications from Sun Microsystems that together provide a system for developing and deploying applications using a bytecode system. Most people will come across Java applets embedded in web pages. Java is also used a lot for server side processing on the web and sometimes even for full desktop applications (though in that arena it has a reputation for being slow and clunky).

Major products and technologies[editar]

Language[editar]

Writing in the Java programming language is the standard way to produce code that will be deployed as Java bytecode (though there are compilers available for other languages such as python and ruby). Java syntax borrows heavily from C and C++ but it eliminates certain low-level tools such as pointers and has a very simple object model (e.g. every object is in its own block on the heap and all variables of object types are references).

Java has non-object primitive types but everything else must be an object as there are no structs. The standard Java libraries have always provided wrapper objects for the primitive types and from version 1.5 the Java compiler automatically inserts conversions between a wrapper type and its corresponding primitive. Memory management is handled through integrated automatic garbage collection by the Java runtime.

Platform[editar]

The Java platform consists of a Java virtual machine and implementations of the standard libraries. In order to allow for different types of system there are now three versions. Sun refer to their implementation of the Java platform as the Java Runtime Environment (JRE).

  • Java ME (micro edition): Specifies several different sets of libraries (known as profiles) for devices which are sufficiantly limited that supplying the full set of Java libraries would take up unaccepablly large amounts of storage.
  • Java SE (standard edition): For generally purpose use on desktop PCs, servers and similar devices.
  • Java EE (enterprise edition): Java SE plus various APIs useful for multi-tier client server enterprise applications.

JDK[editar]

The Java Development Kit (JDK) is a Sun product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java SDK. It contains a Java compiler and a number of other important development tools as well as a full copy of the java runtime environment.

History[editar]

Early history[editar]

Duke, Java's mascot
Duke, Java's mascot

The Java platform and language began as an internal project at Sun Microsystems in December of 1990. Engineer Patrick Naughton had become increasingly frustrated with the state of Sun's C++ and C APIs (application programming interfaces) and tools. While considering moving to NeXT, Naughton was offered a chance to work on new technology and thus the Stealth Project was started.

The Stealth Project was soon renamed to the Green Project with James Gosling and Mike Sheridan joining Naughton. Together with other engineers, they began work in a small office on Sand Hill Road in Menlo Park, California. They were attempting to develop a new technology for programming next generation smart appliances, which Sun expected to be a major new opportunity.

The team originally considered using C++, but it was rejected for several reasons. Because they were developing an embedded system with limited resources, they decided that C++ demanded too large a footprint and that its complexity led to developer errors. The language's lack of garbage collection meant that programmers had to manually manage system memory, a challenging and error-prone task. The team was also troubled by the language's lack of portable facilities for security, distributed programming, and threading. Finally, they wanted a platform that could be easily ported to all types of devices.

Bill Joy had envisioned a new language combining the best of Mesa and C. In a paper called Further, he proposed to Sun that its engineers should produce an object-oriented environment based on C++. Initially, Gosling attempted to modify and extend C++, which he referred to as C++ ++ --, but soon abandoned that in favor of creating an entirely new language, which he called Oak after the tree that stood just outside his office.

The team worked long hours and by the summer of 1992, they were able to demonstrate portions of the new platform including the Green OS, the Oak language, the libraries, and the hardware. Their first attempt, demonstrated on September 3, 1992, focused on building a PDA device named Star7 which had a graphical interface and a smart agent called "Duke" to assist the user. In November of that year, the Green Project was spun off to become FirstPerson, Inc, a wholly owned subsidiary of Sun Microsystems, and the team relocated to Palo Alto. The FirstPerson team was interested in building highly interactive devices, and when Time Warner issued an RFP for a set-top box, FirstPerson changed their target and responded with a proposal for a set-top box platform. However, the cable industry felt that their platform gave too much control to the user and FirstPerson lost their bid to SGI. An additional deal with The 3DO Company for a set-top box also failed to materialize. Unable to generate interest within the TV industry, the company was rolled back into Sun.

Java meets the Internet[editar]

In June and July of 1994, after a three-day brainstorming session with John Gage, James Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt, the team re-targeted the platform for the Web. They felt that with the advent of the Mosaic browser, the Internet was on its way to evolving into the same highly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small web browser, WebRunner, later renamed HotJava.

That year, the language was renamed Java after a trademark search revealed that the name "Oak" was used by a manufacturer of video adaptor cards. The name Java was coined at a local coffee shop frequented by some of the members. It is not clear whether the name is an acronym or not; although some accounts claim that it stands for the names of James Gosling, Arthur Van Hoff, and Andy Bechtolsheim, or Just Another Vague Acronym, it is generally accepted that "Java" does not stand for anything. Lending credence to the idea that Java owes its name to the products sold at the coffee shop is the fact that the first 4 bytes (the so-called "Magic number") of any class file are, in hexadecimal, 0xCAFEBABE.

In October of 1994, HotJava and the Java platform was demonstrated for Sun executives. Java 1.0a was made available for download in 1994, but the first public release of Java and the HotJava web browser came on May 23, 1995, at the SunWorld conference. The announcement was made by John Gage, the Director of Science for Sun Microsystems. His announcement was accompanied by a surprise announcement by Marc Andreessen, Executive Vice President of Netscape, that Netscape would be including Java support in its browsers. On January 9, 1996, the JavaSoft business group was formed by Sun Microsystems to develop the technology.[1] Two weeks later the first version of Java was released.

Recent history[editar]

Web use[editar]

Client side[editar]

The ability of web browsers to run Java applets has ensured the continuing use of Java by the general public. Flash is more widespread for simple interactive animations and developers are beginning to apply Ajax techniques in this area too. Java is often applied to more complex applications like Yahoo! Games and more recently, video players from multiple suppliers (e.g. [2]).

Server side[editar]

On the server side of the Web, Java is more popular than ever, with many websites using JavaServer Pages and other Java-based technologies.

Desktop use[editar]

On the desktop, stand-alone Java applications remain relatively rare for several reasons.[3]

  • Java applications often use a large amount of memory.
  • Graphical user interfaces for Java applications tend not to follow Human Interface Guidelines, let alone the HIG the user is accustomed to. Font smoothing is disabled by default, which makes text look low quality.
  • The tools provided in the Java Development Kit are not powerful enough to easily build useful applications.
  • There are several versions of the Java Runtime Environment. A user must have installed the version required by an application (or any newer version) before installation. The JRE is larger than 7MB and downloading and installing it is inconvenient.
  • Standalone applications have fallen out of favor as computing has switched to a web-based model. New programming techniques have produced powerful web applications.

However, there are some Java applications in fairly widespread use, including the NetBeans and Eclipse integrated development environments, and file sharing clients such as LimeWire and Azureus. Java is also used in the MATLAB mathematics program for rendering the user interface and for part of the calculation functionality. Java Swing and SWT desktop applications are being developed as an alternative to Microsoft .NET technology.

Java runtime availability[editar]

A version of the Java Runtime Environment is available on most desktops. Microsoft has not bundled a Java Runtime Environment with its operating systems since before Windows XP was released in 2001, but most manufacturers of Microsoft Windows systems continue to include a JRE when they ship their systems. It is also shipped as standard on Apple's Mac OS X, as well as most Linux distributions. Because of incompatibilities between different versions of the JRE, rather than rely on pre-installed JREs, many applications install their own JREs in order to function predictably. Those developing Java applets for running in a web browser must either insist thier users upgrade or develop to a very early version of java and then test if anything breaks with more recent versions.

Version history[editar]

Archivo:Java WebStartApplicationMan.png
Java Web Start, first introduced for J2SE 1.3, allows provisioning applications over the Web by clicking a desktop icon or a link on a website.

The Java language has undergone several changes since JDK (Java Development Kit) 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java Language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901.

  • J2SE 5.0 (September 30, 2004) — Codename Tiger. (Originally numbered 1.5, which is still used as the internal version number.[4]) Developed under JSR 176, Tiger added a number of significant new language features: press release
    • Generics — provides compile-time (static) type safety for collections and eliminates the need for most typecasts. (Specified by JSR 14.)
    • Metadata — also called annotations, allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities. (Specified by JSR 175.)
    • Autoboxing/unboxing — automatic conversions between primitive types (such as int) and primitive wrapper classes (such as Integer). (Specified by JSR 201.)
    • Enumerations — the enum keyword creates a typesafe, ordered list of values (such as Day.MONDAY, Day.TUESDAY, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern). (Specified by JSR 201.)
    • Varargs — the last parameter of a method can now be declared using a type name followed by three dots (e.g. void drawtext(String... lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method.
    • Enhanced for loop — the for loop syntax is extended with special syntax for iterating over each member of either an array or any Iterable, such as the standard Collection classes, using a construct of the form:
void displayWidgets (Iterable<Widget> widgets) {
    for (Widget w : widgets) {
        w.display();
    }
}

This example iterates over the Iterable object widgets, assigning each of its items in turn to the variable w, and then calling the Widget method display() for each item. (Specified by JSR 201.)

  • Java SE 6 — Codename Mustang. As of 2006 this is currently in development under JSR 270. A beta version was released on February 15, 2006 press release and is available at http://java.sun.com/javase/6/. Another beta is expected summer 2006 with the final release in autumn 2006. New builds including enhancements and bug fixes are released approximately weekly. As of this version, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number.[5]
  • Java SE 7 — Codename Dolphin. As of 2006, this is in the early planning stages. Development is expected to begin in spring 2006, with release estimated in 2008.[6]

In addition to the language changes, much more dramatic changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5.0. Entire new APIs, such as Swing and Java2D, have been introduced, and many of the original JDK 1.0 classes and methods have been deprecated.