JCreator irritation: 1. Indentation of my programs won't work unless you change the tab size to 8 characters: Configure | Options | Editor Java Tabs Size:8 *********************************************************************** JCreator: COMMAND LINE ARGUMENTS: ch01/TDIncDate.java comment out line 11: //import IncDate.*; compiling this also compiles Date.java and IncDate.java How to execute program and give COMMAND LINE ARGUMENTS: 1. Select Configure > Options. 2. Select JDK Tools. 3. Select Run Application from the Select Tooltip list. 4. Select in the list. 5. Click Edit. 6. On the Parameters tab of Tool Configurations dialog box, click the Prompt for Main Method Arguments checkbox. 7. OK. OK. 8. When Execute, a window pops up for the command line arguments to be typed. (will do so for every program executed). *********************************************************** JCreator: Classpath notes: JCreator: need to specify the folder(s) that are the root(s) of the package trees. In our case it's the bookFiles folder. 1. Select Configure > Options. 2. Select JDK Tools. 3. Select Compiler from the Select Tooltip list. 4. Select in the list. 5. Click Edit. 6. On the Parameters tab of Tool Configuration: Compiler dialog box, 6a.in the Parameters text field, replace "$[ClassPath]" with "C:\Documents and Settings\dwills\My Documents\cmis241\bookFiles;." i.e. whatever the full path to your bookFiles folder is and . meaning the current folder too. 6b. uncheck Use output path 7. OK. 8. Select Run Application from the Select Tooltip list. 9. Select in the list. 10. Click Edit. 11. On the Parameters tab of Tool Configurations dialog box, do the same specification of the classpath parameter: in the Parameters text field, replace "$[ClassPath]" with "C:\Documents and Settings\dwills\My Documents\cmis241\bookFiles;." 12. OK. OK. *************************** Manually from cmd: First, how to run compiler and execute from command line? Digression: ***************************************** What's happening when you compile and run a Java program: When you compile in JCreator, it runs the javac.exe program of the JDK. When you execute a compiled Java program in JCreator, it runs the java.exe program of the JDK. Look in the bin folder of the JDK folder to see these files. Both javac and java can be run manually from the Windows command prompt: 1. Start | Run | cmd starts a command prompt. 2. cd to the folder your source file is in. 3. You will have to give the full path to the javac and java programs: 3a. to compile: C:\Program Files\Java\jdk1.5.0_01\bin\javac HelloWorld.java (or wherever your JDK is) 3b. to execute: C:\Program Files\Java\jdk1.5.0_01\bin\java HelloWorld To avoid having to indicate the full path to the programs, modify the PATH variable to include the bin folder: (from Sun's documentation) Choose Start, Settings, Control Panel, and double-click System. On Microsoft Windows NT, select the Environment tab; on Microsoft Windows 2000/XP select the Advanced tab and then Environment Variables. Look for "Path" in the User Variables and System Variables. If you're not sure where to add the path, add it to the right end of the "Path" in the User Variables. A typical value for PATH is: C:\Program Files\Java\jdk1.5.0_\bin Capitalization doesn't matter. Click "Set", "OK" or "Apply". The PATH can be a series of directories separated by semi-colons (;). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should only have one bin directory for a JDK in the path at a time (those following the first are ignored), so if one is already present, you can update it to jdk1.5.0_\bin. 4. Restart the command prompt for the new path to take effect. 5. javac HelloWorld.java java HelloWorld ************* Classpath stuff manually from cmd: Example using TDSortedList.java in ch03 with cd being ch03 javac -cp .. TDSortedList.java #.. is bookFiles folder java -cp ..;. TDSortedList testlist1.dat outfile To avoid having to use -cp, create CLASSPATH variable Start--ControlPanel--System--Advanced--EnvironmentVariables--New Variable name: CLASSPATH Variable value: C:\Documents and Settings\dwills\My Documents\cmis241\bookFiles;. i.e. full path to your bookFiles folder AND . meaning current working folder. Restart cmd. OR, from cmd: set classpath=C:\Documents and Settings\dwills\My Documents\cmis241\bookFiles;. javac TDSortedList.java java TDSortedList testlist1.dat outfile ******************************************************************** Linux: javac -cp path(s)-to-root-folder MyClass.java Ex. pwd is bookFiles/ch03/ javac -cp .. TDSortedList.java import ch03.genericList compiles all files in genericList/ XP: same java -cp ..:. TDSortedList infile outfile need path to current directory and to bookFiles. XP: use ; instead of : OR: to avoid using -cp option: export CLASSPATH=/home/wills/public_html/cmis241/bookFiles:. into ~/.bash_profile CLASSPATH=/home/wills/public_html/cmis241/bookFiles:.