Input File in Java
<p>I want insert sudoku answer with a txt file . My book instruct me to do as follows : </p>

<p>"It is cumbersome to enter 81 numbers from the console. When you test the program, you may store the input in a file, say <code>CheckSudokuSolution.txt</code> (see www.cs.armstrong.edu/liang/data/CheckSudokuSolution.txt), and run the program using the following command:</p>

<pre><code>java CheckSudokuSolution &lt; CheckSudokuSolution.txt"
</code></pre>

<p>I saved <code>CheckSudokuSolution.txt</code> file in same directory as my java file and tried several times. But command promp shows following error : </p>

<pre><code>"Error : The system can not find the file specified".

import java.util.Scanner;

public class CheckSudokuSolution {
    public static void main(String[] args) {
        // Read a Sudoku solution
        int[][] grid = readASolution();

        System.out.println(isValid(grid) ? "Valid solution" :
        "Invalid solution");
    }

    /** Read a Sudoku solution from the console */
    public static int[][] readASolution() {
        // Create a Scanner
        Scanner input = new Scanner(System.in);

        System.out.println("Enter a Sudoku puzzle solution:");
        int[][] grid = new int[9][9];
        for (int i = 0; i &lt; 9; i++)
            for (int j = 0; j &lt; 9; j++)
                grid[i][j] = input.nextInt();

        return grid;
    }

    /** Check whether a solution is valid */
    public static boolean isValid(int[][] grid) {
        for (int i = 0; i &lt; 9; i++)
            for (int j = 0; j &lt; 9; j++)
                if (grid[i][j] &lt; 1 || 
                    grid[i][j] &gt; 9 || 
                    !isValid(i, j, grid)
                )
                    return false;
                return true; // The solution is valid
    }

    /** Check whether grid[i][j] is valid in the grid */
    public static boolean isValid(int i, int j, int[][] grid) {
        // Check whether grid[i][j] is unique in i's row
        for (int column = 0; column &lt; 9; column++)
            if (column != j &amp;&amp; grid[i][column] == grid[i][j])
                return false;

    // Check whether grid[i][j] is unique in j's column
    for (int row = 0; row &lt; 9; row++)
        if (row != i &amp;&amp; grid[row][j] == grid[i][j])
            return false;

    // Check whether grid[i][j] is unique in the 3-by-3 box
    for (int row = (i / 3) * 3; row &lt; (i / 3) * 3 + 3; row++)
        for (int col = (j / 3) * 3; col &lt; (j / 3) * 3 + 3; col++)
            if (row != i &amp;&amp; col != j &amp;&amp; grid[row][col] == grid[i][j])
                return false;

    return true; // The current value at grid[i][j] is valid
    }
}
</code></pre>

<p>how can I compile this java program with CheckSudokuSolution.txt file using command line ?</p>