To Documents

Using the Java Compiler

 

  1. Install the Java software:   Find and run the self-extracting zip file named jdk-6-windows-i586.exe on the disk that came with your textbook. It should install the Java software into the folder

     

  2. Set the path environment variable:

    1. Select Start and Control Panel.

    2. Select System >> Advanced Tab >> Environment Variables Button.

    3. Find the Path variable in the System Variables box. Click the Edit Button.

    4. If the path to the Java executable exists, modify it to look like this:

        C:\Program Files\Java\jdk1.6.0_02\bin

      If the path to the Java executable does not exist, append it to the end of the path:

        ;C:\Program Files\Java\jdk1.6.0_02\bin

      Note the semicolon at the beginning.

     

  3. Compile and Run

    1. Invoke the Command Prompt: Start >> All Programs >> Accessories >> Command Prompt.

    2. Navigate to the folder containing the source code with the DOS cd command. Example:

        > cd proj1

    3. Compile the Java source code file:

        > javac BitwiseSmith.java

    4. Run the Java source code file:

        > java BitwiseSmith