Before I explain what Java is, it would be helpful to give you some preliminary background information.
The reason people buy computers is to run programs. A computer program is nothing more than a set of instructions that gets the computer to do what you want it to do, whether it's to write and print a letter, balance your checkbook, or blast an alien in your favorite game. The most basic form of instruction your computer's brain can understand is called machine code, or native code. Each different computer platform—for example, Windows-based, Apple Macintosh, or Unix-based—requires a different type of machine code, since each has a different type of main brain chip (486, Pentium, PowerPC, etc.)
Computer programs can either be written directly in this low-level machine code, which is very tedious, or in high-level languages which are more like human English than primitive computerese, and which in turn generate the machine code. One line of a high-level programming language such as C++, Basic, or Pascal can generate many lines of machine code, making the task of programming much faster and easier.
There are two basic categories of programming languages: compiled and interpreted. With languages like C++ the source code generated by the language is compiled into machine code that can be directly executed by your computer, usually saved as a program file to be run later. With an interpreted language like Basic, the source code generated by the programming language is interpreted and executed by the computer right on the spot, line by line. This makes a program running under an interpreter generally slower than a compiled program.
Now, to answer the question at hand. Java is a programming language originally developed by Sun Microsystems in 1991 as a language for embedded applications such as those used in TV set-top boxes, hand-held devices, and other consumer-oriented electronics. Sun converted it to the Internet's World Wide Web in 1994, and it has started a revolution. The reason? Well, there are several reasons.
First off, although it is considered an interpreted language, Java has characteristics of both compiled and interpreted languages. Java source code is first compiled into an intermediate form called "byte code," which cannot run by itself, and is not optimized for any specific platform. It is a highly compressed representation of the source code, but it is not machine code, and therefore not tied to any particular hardware. This byte code is converted into machine code at the time you run the program by a platform-specific interpreter, called a Java Virtual Machine, or JVM.
Normally, programs written for one platform—Windows, for example—must be re-written, or ported, to run on another platform such as the Macintosh. But any platform for which a Java Virtual Machine exists can run programs written in Java. Since the Internet is populated with computers of many types, programs written in Java can be distributed over the Internet and run by these varied computers via their JVMs.
This "write once, run anywhere" capability of Java is especially attractive to application developers, and extremely useful for Internet users. Sun's own Web browser, HotJava, was the first to incorporate a built-in Virtual Machine capable of running Java programs, which usually take the form of a little application, or "applet." Netscape Navigator was the next browser to feature Java support, and finally Microsoft joined the club with its Internet Explorer browser. Version 3 or higher of each browser is recommended. On the Web, Java is activated by a special HTML tag on a web page.
Although the most popular use of Java these days is to create simple applets such as scrolling banners and animation on Web pages, it can also be used for building full-blown applications. In fact, Corel Office for Java is the first suite of office productivity applications written entirely in Java and supported by Netscape Navigator 3.01 and higher. It consists of a word processor, spreadsheet, charting program, presentation application, and information manager. The prerelease, or beta, version, which must run within a Java-enabled browser, can be downloaded for free at http://officeforjava.corel.com/.
Given the runaway popularity of Java, a JVM will eventually be built into all mainstream desktop operating systems, allowing Java programs and applets to run outside of a Web browser environment. In fact, the upcoming new version of the Macintosh operating system, Mac OS 8, scheduled to be released sometime in Summer '97, will be the first desktop operating system with built-in Java support. This will allow Java applications to run just as though they were any other desktop applications, including the Corel software suite.
With regard to performance, the fact that Java programs are interpreted at runtime means they aren't exactly speed demons, but some Java VMs include what's called just-in-time compilers (JITs), which significantly increase performance. Java applications can also be compiled into machine language for fastest performance, but they lose their hardware independence as a result.
Java is an inherently secure language. It was designed so that applets cannot alter files on a computer's hard drive unless the client, or user, gives permission. Hackers will find it difficult to use Java applets to spread viruses or cause other damage due to the structure of the Java programming language.
K.O.P.C.Online home > table of contents > Java