Developing Java Programs
Java is a relatively new language, and the the situation regarding
tools for Java programming is a little confusing.
Sun gives away packages
with a command-line compiler and libraries for developing Java
code; these packages are called JDK (for Java Developer's Kit).
The commonly used editions at this time are JDK: 1.1,
1.2.2, and 1.3. JDK 1.2 and JDK 1.3 are both referred to
be Sun as " Java 2".
In writing a Java program,
you use a text editor of some kind to make one or more *.java
files. You use a Sun utility known as javac.exe to
compile the *.java files into *.class files. The compiler
will pull in a number of Java library or "package" files
from your disk and link them into your code. And then you
execute the *.class files and see a program running by using either
(i) a Sun "virtual machine" utility known as java.exe
or (ii) a web browser. The Java libraries, javac.exe, and
java.exe all come as part of the JDK.
The various Java JDK (sometimes also called SDK for Software
Devloper's Kit) are downloadable from
the Web at Sun's java.sun.com site. A JDK includes, among
other things, the javac.exe and java.exe utilites as well as some
libraries of *.java code files. Note that it's okay to install
several JDK on your machine, in separate directories.
Another point to mention here is that when you go to the Sun
download page, you have a choice of getting the SDK or the Runtime
Environment. Normally you would want the SDK.
The "SDK "includes all the libraries, the javac.exe
compiler, the java.exe virtual machine, and a plug-in to (maybe)
make the Java files work with your current web browser.
The "Runtime Environment" leaves out the javac.exe
compiler, but includes some of the libraries, the virtual machine,
and the plug-in.
the JDK 1.3 for Windows From Sun. This is a whopping 30 Meg
(If you want a different version or a different platform, go
to this page instead:Download a JDK From Sun. )
But, hold on, before you
do the long download, figure out which IDE you are going to use
(see below). The thing is, many of the IDE's come with a
version of JDK and Java documentation on the disk, so maybe you
don't have to do the huge download.
There is another thing you
can download, this is the "Documentation". You
definitely would like to get this too To get documentation for
the Java SDK, you can download the documentation, which is in
HTML format (and a whopping 17 Meg) . Alternately, you can
browse the documentation online at Paintings & Links JDK 1.3 Documentation
or Paintings & Links Java 1.1
By the way, if you can't manage the huge downloads, you can buy
these wares directly from Sun on CD. Also note that some
Sun downloads are only availabe during business hours on weekdays.
The Sun Java SDK does not
come with any type of IDE (integerated developer environment).
For simple programs you you can use the Windows Notepad accessory
or the Wordpad accessory.
An Integrated Development
If you plan to write Java
programs of any size, you really need an IDE (integrated development
environemnt) that has integrated help, which lets you build and
run from the edit interface, which highlights errors, and which
has some debugging capability. There is no perfect Java
IDE at this time. Here are a couple of options. You'll
notice, by the way, links to a number of Java IDE on the page
for Download the JDK
1.3 for Windows From Sun.
There are various goals
in choosing your compiler. Unfortunately these goals are incompatible.
(1) An IDE (Integrated Development Environment) similar to, for
instance Visual C++; that is, a multi-windowed environment in
which we can edit, compile, and run our programs, with ability
to pop up help files and perhaps even do some WYSIWYG (What you
see is what you get) editing of our GUI (Graphical User Interface).
(2) Write Java applets that are useable by a wide range of browsers.
(3) Run in a stable fashion on your machine.
(4) Support the latest features of Java.
(5) Don't have to do huge downloads over the Web.
(6) Pay very little.
(1) is satisfied by all
except the TextPad solution.
(2) is a subtle issue. Only
JDK 1.1 makes java programs that run on most existing web browsers.
JDK 1.2 and 1.3 don't run on older versions of browsers (this
applies both to Navigator and to Netscape) without the user having
to download a huge (12 Meg) browser plug-in. Sun Forte won't
let you use JDK 1.1.
(3) fails for Sun Forte,
unless you have 128 Meg of RAM. I think Visual Cafe is OK
with less RAM, but I'm not totally sure.
(4) fails for Microsoft
J++, which only goes up to JDK 1.1. All the others are OK
with higher versions.
(5) is an issue for either
the WordPad or Forte solutions, as you get these free over the
(6) Visual J++ costs $30
(at SJSU) and Cafe costs I think $99. Wordpad and Forte
are free. But remember: you get what you pay for.
This Java compiler is
on some machines in our lab, but is being phased out in favor
of Forte. In addition, you can rent an installation disk
for J++ from the SJSU bookstore for $30 for four days, and install
J++ on your home machine. A nice thing about commercial software
is that you get the whole thing on one CD and don't have to do
any downloads. JDK, IDE, documentation, all on one handy
J++ is a very nice IDE.
It seems to run easily on most machines, and doesn't require that
you have a lot of RAM. The catch is that J++ doesn't
support JDK 1.2 and higher. Given that JDK 1.2 doesn't run
on many browsers, this isn't as a big a handicap as you might
think. And for the code we're going to be writing, JDK 1.1
is close enough to JDK 1.2 for most programs.
Even so, it is annoying
not to have the latest and greatest version of Java and for many
people, Microsoft's pig-headed and quixotic refusal to support
JDK 1.2 and higher is a show-stopper.
Sun provides a free Java
IDE called Forte, which is a fairly serviceable IDE for Java development.
You can download it (I think only on weekdays) from Sun's Forte For Java Community
Edition Download page. You need at least 128
Meg of RAM on your computer to run this program. If you run it
with low amounts of RAM it will crash unexpectedly, taking your
code with it. If you don't have 128 Meg of RAM, don't bother
getting the download --- OR get some more RAM. Related to the
fact that the thing uses a lot of RAM is that it feels a little
wobbly when it runs. Forte is on our lab machines. I find
the program too slow and too unergonomic (you can't use the mouse
wheel to scroll and there aren't many hotkey shortcuts, you have
to click a lot) to really be useable.
Last time I checked, the download is 7 Meg, which unzips to 23
Meg. It has an odd user interface (designed in Czechoslovakia),
but perhaps I'll get used to it. I'm not sure if the download
includes a JDK and documentation or not, it's possible that these
may be separate downloads. But if you plan to use Forte,
download it first and then see what else you might need.
One way around the brutally large downloads is to buy the wares
on CD from Sun. But if you're buying software, you would
do better to buy a commercially devolped Java compiler instead
of this one.
I've used this some. It's not bad. It has the same
high-RAM requirement as Sun Forte, but it supports and JDK you
like. Check it out at the JBuilder
site, I think you can get a free trial version.
never tried Visual
Cafe, but I have this notion that it might be good, and will
check it out soon. My impression is that combines the good
features of Microsoft J++ (it comes complete on a CD with no downloads,
feels solid, has a standard user interface, and runs with a modest
amount of RAM) with the good features of Sun Forte (supports JDK
1.2 and 1.3!). If I were buying a compiler myself, I think
I would try this one, but maybe that's just because I already
know all the others have something wrong with them. The
catch here is a list price of $99 for the Standard version.