title: Could not find or load main class - for any program
body: <p>I'm having a problem where the <code>java</code> command - no matter what I'm trying to run, says that it <code>Could not find or load main class</code>.</p>
  
  <p>Everything is fine when compiling with javac, <code>.class</code> files are created. So when I run:</p>
  
  <pre><code>javac HelloWorld.java
  </code></pre>
  
  <p>on </p>
  
  <pre><code>public class HelloWorld{
      public static void main(String[] args){
          System.out.println("Hello World");
      }
  }
  </code></pre>
  
  <p>everything compiles fine, a <code>HelloWorld.class</code> file is created along side the <code>HelloWorld.java</code> file. However when I then go to run:</p>
  
  <pre><code>java HelloWorld
  </code></pre>
  
  <p>1) the most telling sign is that when I press <code>Tab</code> to autofill <code>HelloWorld</code> nothing comes up.</p>
  
  <p>2) when I do run it, I get the <code>Error: Could not find or load main class HelloWorld</code> despite it being in the same directory, not being part of a package, compiling fine with a <code>.class</code> file, the program having a main class.</p>
  
  <p>For reference running <code>Fedora 23 64bit, openjdk version "1.8.0_111"</code>.</p>