Before you venture further into Java programming, it’s worthwhile to learn more about the language and see what programmers are doing with it today. Though Java has outgrown its origins as a language focused on web browser programs, you can still find some interesting examples of how Java is used on the Web.

During this hour, we take a look at sites that feature Java programs and talk about the history and development of the language.

To go on this vacation, you need a web browser that has been set up to run Java programs.

Load your browser of choice, put on your best batik shirt, and get ready to take a vacation. You won’t be leaving your house, and you won’t experience the simpler pleasures of tourism, such as reckless cab drivers, exotic food, exotic locals, exotic locals with food, and so on. Look on the bright side though: no traveler’s check hassles, no passports, and no Montezuma’s revenge.

First Stop: Oracle

The Java vacation begins at www.java.com, a site created by Oracle, the company that owns the Java language.

A Java program that runs as part of a web page is called an applet. Applets are placed on pages like other elements of a page. A markup language called HTML defines where the program should be displayed, how big it is, and what the program does when it runs. Java also enhances the Web in two other ways: Desktop programs written in Java can be launched from a web browser, and Java servlets are run by web servers to deliver web applications.

Oracle’s Java division leads the development of the Java language and related software. The Java in Action section of Java.com showcases how Java is being used on websites, Android phones, and other platforms. Millions of devices run programs written with Java. Figure 3.1 shows RuneScape, a massively multiplayer online game powered by Java. You can play the game for free by using any web browser to visit www.runescape.com.

Java.com provides a place to learn about how Java is being used. Oracle also offers a more technically oriented website for Java programmers at http://www.oracle.com/technetwork/java. This site is the place to find the latest released versions of NetBeans and the Java Development Kit along with other programming resources.

A Brief History of Java

Bill Joy, one of the executives at Sun Microsystems when the company created Java, called the language “the end result of 15 years of work to produce a better, more reliable way to write computer programs.” Java’s creation was a little more complicated than that.

Java was developed in 1990 by James Gosling as a language that would serve as the brains for smart appliances (interactive TVs, omniscient ovens, SkyNet military satellites that enslave mankind, and so on). Gosling was unhappy with the results he was getting by writing programs with a programming language called C++. In a burst of inspiration, he holed up in his office and wrote a new language to better suit his needs.

Gosling named his new language Oak after a tree he could see from his office window. The language was part of his company’s strategy to make a fortune when interactive TV became a multimillion-dollar industry. That still hasn’t happened today (though Netflix, TiVo, and others are making a game attempt), but something completely different took place for Gosling’s new language. Just as Oak was about to be scrapped, the Web became popular.

NOTE

You might have heard that Java is an acronym that stands for Just Another Vague Acronym. You also might have heard that it was named for the Gosling’s love of coffee. The story behind Java’s naming contains no secret messages or declarations of liquid love. Java was chosen as the name for the same reason that comedian Jerry Seinfeld likes to say the word salsa: It sounds cool.

In a fortuitous circumstance, many qualities that made Gosling’s language good on its appliance project made it suitable for adaptation to the Web. His team devised a way for programs to be run safely from web pages and a catchy new name was chosen to accompany the language’s new purpose: Java.

Although Java can be used for many other things, the Web provided the showcase it needed. When the language rose to prominence, you had to be in solitary confinement or a long-term orbital mission to avoid hearing about it.