title: Could not find or load main class osx terminal
body: <p>None of the answers to this common question solve my problem.</p>
  
  <p>I have a file directory tree like such</p>
  
  <pre><code>root
   |
   +--&gt; com
          |
          +--&gt; Game.java
          +--&gt; Window.java
  </code></pre>
  
  <p>I compiled <code>Game.java</code> and <code>Window.java</code> sucesffully and the resulting tree is like so</p>
  
  <pre><code>root
   |
   +--&gt; com
          |
          +--&gt; Game.java
          +--&gt; Game.class
          +--&gt; Window.java
          +--&gt; Window.class
  </code></pre>
  
  <p>I changed directory back to root and ran the following command from the osx terminal</p>
  
  <blockquote>
    <p>java com.Game</p>
  </blockquote>
  
  <p>and the I received the following error </p>
  
  <blockquote>
    <p>Could not find or load main class</p>
  </blockquote>
  
  <p>I'm not sure why, here are my classes </p>
  
  <p><code>Game.java</code></p>
  
  <pre><code>package com;
  
  import java.awt.*;
  
  public class Game extends Canvas implements Runnable {
  
      private static final long mSerialVersionUid = -240870510533527854L;
  
      public static final int WIDTH = 640, HEIGHT = WIDTH / 12 * 9;
  
      public Game(){
  
          new Window(WIDTH, HEIGHT, "Let's build a game!", this);
      }
  
      public synchronized void start(){
  
      }
  
      @Override
      public void run(){
  
      }
  
      public static void main(String[] args){
  
  
      }
  }
  </code></pre>
  
  <p><code>Window.java</code></p>
  
  <pre><code>package com;
  
  import java.awt.Canvas;
  import javax.swing.JFrame;
  import java.awt.Dimension;
  
  public class Window extends Canvas {
  
      public Window(int width, int height, String title, Game game){
  
          JFrame frame = new JFrame(title);
  
          frame.setPreferredSize(new Dimension(width, height));
          frame.setMaximumSize(new Dimension(width, height));
          frame.setMinimumSize(new Dimension(width, height));
  
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setResizable(false);
          frame.setLocationRelativeTo(null);
          frame.add(game);
          frame.setVisible(true);
          game.start();
      }
  }
  </code></pre>