This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
PATH and CLASSPATH are two Windows variables you set in AUTOEXEC.BAT to allow you to compile and run Java programs. Setting PATH allows you to type java KnightsTour at the C:\> prompt, and run your class file KnightsTour.class. Without setting this PATH variable, you would have to type jdk1.3\bin\java KnightsTour at the C:\> prompt every time. (In this example, your PATH variable would have to contain "C:\jdk1.3\bin".) Just as the PATH variable tells Windows where to look for the command you're passing to it ("java"), the CLASSPATH variable tells Java where to find the top level of class files you're passing to it. For example, I have my CLASSPATH set to "C:\Java\docs". So if I put a source file in my C:\Java\docs folder, I type javac Source.java , and Java knows to look for the file in C:\Java\docs. Say I have another source file, Source2.java, that I've indicated in my program lives in package com.artmetzer. Then, I need to do the following: 1) Create a folder called "com" in the existing folder C:\Java\docs. 2) Create a folder called "artmetzer" in the just-created folder C:\Java\docs\com. 3) Save Source2.java in C:\Java\docs\com\artmetzer. 4) At the MS-DOS prompt, I change directories to my classpath directory, C:\Java\docs. 4) At the MS-DOS prompt, since my PATH and CLASSPATH variables are set, I type at the C:\Java\docs> prompt javac com\artmetzer\Source2.java to compile Source2.java. Then, after it compiles successfully, I type at the C:\Java\docs> prompt java com.artmetzer.Source2 to run the code in Source2. Hope this helps, Dhanashree, and good luck. Art