Using the Just Java CD-ROM

Using the Just Java CD-ROM

About the CD-ROM

Welcome to the Just Java CD-ROM—a disk packed with Java tools and source code discussed in the book and lots more.

This CD is for any reasonably modern system that can read a CD with a UDF file system. That includes Unix, Windows, and MacOS but may exclude some vintage PCs.

There is a huge amount of useful, entertaining, or educational material on this CD. Some of the content (and there is a lot more) is:

• Useful

Java Programmer’s FAQ and Glossary. Decompilers and obfuscators.

• Educational

Translators for Perl, TCL, Eiffel, C, C++, Python, etc. CIA World Fact Book—your tax dollars at work. Java Digital Simulator.

• Entertaining

Java program to solve crossword puzzles. The Jargon File The Sherlock Holmes books. Java Bible Code software. Look for hidden messages.

Explore the CD-ROM using a browser. Put the CD in your computer and point your browser at the index.html file in the root directory with a URL like “file:/e:/index.html” (substitute the right letter for the CD drive if it is not ‘e’).

You’ll see a display like that shown in Figure P-1.

Browsing the CD.

Figure P-1. Browsing the CD.

If you click on, for example, the “digisim” link at the bottom of the page, the browser will take you to that directory, and the display will now look like Figure P-2.

Java Digital Simulator.

Figure P-2. Java Digital Simulator.

Some of the content on the CD is in applet form, and you can run the programs as you browse them. The program shown in Figure P-2 is a digital simulator applet, allowing you to drag and drop icons representing electronic components to make circuits. It comes with a demo LED circuit (shown).

You can carry on exploring the CD, and also use the “back” and “forward” buttons in the browser. There are hundreds of megabytes of data of interest to a professional programmer on this CD, including many freeware or shareware compilers for other programming languages.

Your next step should be to download and install a Java Development Kit. That used to be called a “JDK,” but recently Sun has started calling it the “Java 2 Standard Edition SDK.” The JDK software is not on the CD, but there are links to the download sites on the CD. Choose the latest (highest version number) JDK for your system. You should also download and install the HTML documentation for the release. You will be refering to that a lot as you read through these chapters.

The J2 SDK is about a 40 Mbyte download, which will take about two hours to download on a 56 Kb dial-up connection. The Java 2 SDK documentation is about a 30 Mbyte download, taking about one and a half hours to download.

Follow the instructions at the download site to install these downloads.

Running the Java Tools

Many programmers today do their development using an IDE. Other programmers, often those who learned programming on non-Windows systems, prefer to use command line tools.

There are many excellent IDEs available that support Java—some free and even some open source. Sun allows free download of the “Forte for Java” IDE. It runs on Solaris, Linux, and Windows, and can be found at www.sun.com/forte/ffj/buy.html.

My recommendation is that you write your first few Java programs using only an editor and the command line tools from an MS DOS window (on Windows). The Windows Notepad editor (under Start-> Programs -> Accessories) works fine. That way, you can focus on just Java, and you don’t have to figure out an IDE at the same time

Pathnames Used Throughout This Book. The source code for the Java runtime library is supplied as part of the JDK. It’s in a file called src.jar that you need to unpack using winzip or other utility. Jar files have the exact same format as zip files.

From time to time, I will refer you to particular files in the runtime library. The first part of the pathname will depend on where you installed JDK, and I’ll represent this by “$JAVAHOME.”

The separators in a pathname are different on Unix than on Windows. For example, I may recommend you look at a file located here:

$JAVAHOME/src/java/awt/Window.java

If you installed Java on your PC at C:jdk1.4, then the file to review is here:

C:jdk1.4srcjavaawtWindow.java.

Enough of the administrative details! Let’s go on to look at our first Java program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.25.67