Getting the Java SDK

To create your own Java applications, you'll need to get and install the Java SDK; you can find it at http://java.sun.com/j2se/ (download the Software Development Kit, SDK, not the Java Runtime Environment, JRE). The current version of Java as of this writing is 1.4. After downloading the Java SDK, usually as one executable package that installs itself, follow the installation instructions on the http://java.sun.com site.

The Java SDK

At this point, I'd love to be able to give detailed instructions on how to install the Java SDK, but that's a trap too many books have fallen into. The actual installation procedure has changed so often and so many times that any book that covers Java (and I've written many on Java) and tries to give those instructions is sure to make itself obsolete immediately. On the other hand, in recent versions, all you have to do is run an executable program that you download, and it'll do all the work for you.

As indicated in the Sun installation instructions, you have to make sure your machine can find the Java tools, including the Java compiler, javac. To do this, make sure that the Java bin subdirectory is in your computer's path . For example, in Windows, the bin subdirectory might be c:\jdk1.4\bin for the Java 2 SDK, version 1.4. You can use a line like this at the command prompt to put that directory into your path:

 C:\>SET PATH=%PATH%;C:\JDK1.4\BIN 

You can also set the computer's PATH environment variable permanently so that the path is set up correctly each time you reboot. How you do that varies by operating system. Take a look at the installation instructions for Java to see how to do this; you'll find them at http://java.sun.com/j2se/1.4/install.html for Java 1.4, http://java.sun.com/j2se/1.4.1/install.html for Java 1.4.1, and so on.

Now that the bin directory is in the path, you'll be able to use the Java tools from the command line without specifying their full path; otherwise , you'll have to preface them with a pathname each time you want to use them, like this in Windows:

 C:\>C:\jdk1.4\bin\javac ch10_01.java 


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net