Java isn't automatically including class
<p>This seems like a simple problem, but somehow I'm having issues with this code. I'm getting back into Java after a few years, and I'm making a 2D game. In it, I have a main driver class called <code>SnakeGame</code> that loads a new instance of the class <code>GameBoard</code>.</p>

<p><strong>SnakeGame.java</strong></p>

<pre><code>package snake2;
import javax.swing.JFrame;

public class SnakeGame extends JFrame {

public SnakeGame() {
    add(new GameBoard());

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(320, 340);
    setLocationRelativeTo(null);
    setTitle("Snake Game");

    setResizable(false);
    setVisible(true);
}

public static void main(String[] args) {
    new SnakeGame();
}
}
</code></pre>

<p>In the same directory lies <strong>GameBoard.java</strong>, which has a constructer with no required parameters:</p>

<pre><code>public GameBoard() {
    [... more code ...]
}
</code></pre>

<h2>Edit</h2>

<p>Both <code>GameBoard.java</code> and <code>SnakeGame.java</code> have <code>package snake2;</code> at the first line of their files.</p>

<p>However, I keep receiving the following error:</p>

<pre><code>SnakeGame.java:7: cannot find symbol
symbol  : class GameBoard
location: class snake2.SnakeGame
    add(new GameBoard());
            ^
1 error
</code></pre>

<h2>Edit #2</h2>

<p>I've tried to add it to my class path, using <code>java -cp . GameBoard</code> after <code>javac</code>. Here's the first line of the terminal's scary looking and unnecessarily verbose response:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: GameBoard (wrong name: snake2/GameBoard)
</code></pre>

<p>This is as if I've misspelled the class, or misspelled a file name. Although, to my knowledge, I haven't done either. Is there some other problem with my code that I haven't noticed?</p>

<p>Thanks for any help in advance.</p>
