Owl Teach Yourself Java 2 in 21 Days, Second Edition
HOME / ORDER THE BOOK / OTHER BOOKS / THANKS
ROGERS CADENHEAD

Using the SDK on a Windows System

If you're using Windows XP, 2000, or NT, skip to the next section.

Setting Up the PATH on Windows 95, 98, or Me

On a Windows 95, 98, or Me system, the root folder of your Windows system should contain a file called AUTOEXEC.BAT. This file is used by MS-DOS to configure how the operating system and some command-line programs function.

AUTOEXEC.BAT is a text file you can edit with Windows Notepad. Start Notepad and open the file \AUTOEXEC.BAT to begin editing it. (The slash in front of the filename causes Notepad to look for it in the root folder.)

When you open the file, you'll see a series of MS-DOS commands, each on their own line, as shown below.

Editing AUTOEXEC.BAT

The only commands you need to look for are any that begin with PATH or SET CLASSPATH=.

The PATH command is followed by a space and a series of folder names separated by semi-colons.

PATH is used to help MS-DOS find programs when you run them at a command line. In the preceding example, the PATH command highlighted in yellow includes three folders:

  • C:\PROGRA~1\MSOFFICE\OFFICE
  • C:\PROGRA~1\MSBOB
  • C:\jdk1.3\bin

You can see what PATH has been set to by typing the following command at an MS-DOS Prompt:

  • PATH

To set up the Software Development Kit correctly, the folder that contains the Java interpreter must be included in the PATH command in AUTOEXEC.BAT. The interpreter has the filename java.exe. If you installed the SDK in the C:\jdk1.3 folder on your system, java.exe is probably in C:\jdk1.3\bin.

If you can't remember where you installed the SDK, you can look for java.exe by clicking the Start button, choosing Find, and clicking Files or Folders. You may find several copies in different folders. To see which one is correct, open an MS-DOS Prompt window and do the following for each copy of the program:

  • Use the CD command to open a folder that contains java.exe.
  • Run the command java -version in that folder.

When you know the correct folder, create a blank line at the bottom of the AUTOEXEC.BAT file and add the following:

  • PATH rightfoldername;%PATH%

For example, if c:\javajdk\bin is the correct folder, the following line should be added at the bottom of AUTOEXEC.BAT:

  • PATH c:\javajdk\bin;%PATH%

The %PATH% text keeps you from wiping out any other PATH commands in AUTOEXEC.BAT.

After making changes to AUTOEXEC.BAT, save the file and reboot your computer. Once this is done, try the java -version command. If it works, your SDK may be configured correctly. To see if it is, continue to the next page.

Setting Up Path on Windows NT, 2000, or XP

On a Windows 2000, NT, or XP system, you must set up at least one environment variable to use the SDK. These variables are part of the Windows Control Panel.

To change your variables:

HOME / ORDER THE BOOK / OTHER BOOKS / THANKS

Workbench | Books | RSS Feed | RSS Spec | Copyright 2018 World Readable