Just What is Java?
Dateline: 03/15/99
With last year's Just What is Java
article appearing a little dated, I thought it might be worth an
update for those new to Java and wondering what in the world it
is.
Whenever I teach Java to a new group of developers, I start by
explaining just what Java is and isn't. While Java is another
term for coffee, you don't
have to drink coffee or know how to brew coffee to
be able to program with Java. In addition, while Java
is an island in Indonesia, you don't have to be able to find Java
on a map
or have visited Krakatau
in order to be able to program with Java. In addition, Java is
NOT JavaScript.
While the two have similar sounding names, they are really
unrelated. (JavaScript is a scripting language from Netscape for making web
pages more dynamic.)
What Java is all about is a computing platform from Sun Microsystems. While Java is
a programming language, just the language is not what Java is. In
addition to being a programming language like C, C++, Visual
Basic, or Pascal, Java provides a growing set of common libraries
available on all Java run-time platforms.Yes, these other
languages provide libraries, too. However, the level and scope of
the standard libraries available in Java far exceed those
available in any other language. These libraries are part of the
Java platform. They are NOT a third party add-on. While they can
be created by third parties, the programming interface (or API)
is well defined and controlled by Sun. So, if I get a Java
extension library from SGI because I have an Irix system and you
get the extension library from Intel because you are using a
Windows PC, the same program which uses the library will work on
both because the library API is standardized.
In addition to being a language and a set of libraries, Java
also defines what are called byte codes. When you compile a
program written in the Java language, the program is NOT compiled
into something that will run on a specific platform. A Java
program is compiled into Java byte codes. These byte codes are
platform neutral. When the Java byte codes, or class files as
they are also called, are transported over the network, it
doesn't matter what machine is waiting for them. Any machine with
a compatible Java Virtual Machine (or JVM) will be able
to run the program.
So, when we say Java, we are usually talking about three
different things:
- Java the language
- Java the libraries
- Java the byte codes
By compatible JVM, this usually has to do with Java versions.
When Java was first released three years ago, it was called Java
1.0 and the Netscape Navigator 2.0 browser provided the first
browser support for this version of Java. Later, Internet
Explorer 3.0 included Java 1.0 support as did Navigator 3.0. When
Java 1.1 came out about a year later, it took another six months
or so for there to be any semblance of browser support for this
version (in the 4.0 browser versions). Now, with the Java 2
platform (a.k.a. Java 1.2) the current version, you have to get a
browser add-in (the Java Plug-in) to
use the new version in the browser. Clearly, this shows that Java
is continually evolving. And, just as you get comfortable with
one version, something new is sure to be coming along soon.
The key reason that Java has taken the world by storm is its
ease of creating programs for the Internet, and its ability to
run these programs in a secure model. While Java eases Internet
programming, it also is great for other environment, like on
corporate intranets. This ease of use has helped Java grow so
quickly.
When you hear about Java programs, there are at least three
common varieties:
- applet - A Java program that runs within a web browser
- application - A standalone Java program
- servlet - A Java program that runs within a web server
While an applet implies a small application, please don't
think of it in that manner. Its an applet purely from a delivery
mechanism. Normally, they are small, because the program must be
shipped over the network. However, in a corporate intranet where
bandwidth isn't an issue, an applet could be huge. Servlets on
the other hand never get transferred anywhere. They always run
just on the web server. This seems where Java is growing the
fastest. While applets are great, there have been some
incompatibilities in the web browsers which have caused applet
development to flounder a little.
Well, that's all the background for this week. If you need
more, stop by the Recommended
Reading on Java area for some links to some interesting
articles and resources. If you want to get started with Java
development, you need a Java
Development Kit. This is a platform specific set of command
line tools to create Java programs. If you like graphical
development environments, get an IDE.
The tutorial list also provides
a set of beginning and advanced tutorials to get you started. Sun
offers The
Java Tutorial to help you get started and you can check out
the Free Java Book list,
too. If you still need some help, Sun has a free developer
resource called the Java
Developer Connection. And, for a glossary of Java terms,
Roedy Green maintains a helpful Java Glossary.
Good luck.
Interesting Tidbits
The gang at Fawsett Technical Publications (Java Pro magazine) seem to
like the funky Tongan URLs in the .to domain. Check out Java
how to at http://www.javahow.to/.
Are you a COBOL programmer just learning Java? If so, try out
IBM's Introduction
to Java for COBOL Programmers tutorial.
Other Tidbits
Do you teach Java at a university, college, or
primary/secondary school? If so, you can use most, if not all, of
Sun's commercial products
for free for use in teaching. Stop by Sun's Global Free Java Software
for Teaching resource for details.
I'll be back next week with more things to do and places to
go. If you have any comments about this week's feature, be sure
to post them to the bulletin board.
If you have any questions or topic suggestions, let me know or submit feedback.
See you next time.
Previous Features
|