My program runs fine from eclipse but gives array out of index exception in Terminal
<p>I'm using eclipse for a Java project. This is how I get the input from the terminal:</p>

<pre><code>java TicTacToe O X O X # O X O _ _ _ _ Y
</code></pre>

<p>These are arguments I put in eclipse:</p>

<p>O X O X # O X O _ _ _ _ Y</p>

<pre><code>public static void main(String[] args) {
    char [][] board = new char [3][4];
    int strIncr = 0;
    char printFlag;

    //construct init board
    for (int i = 0; i &lt; 3; i++) {
        for (int j = 0; j &lt; 4; j++) {
                board[i][j] = args[strIncr].charAt(0);
            strIncr++;
        }
    }
    printFlag = args[strIncr].charat(0);
}
</code></pre>

<p><strong>Problem:</strong></p>

<p>I seem to be getting an array out of index exception when running from terminal once i >=1. I do not encounter this issue while running from eclipse. I think the issue is related to the # because when I change that it works. help please.</p>