title: How can I fix a java.lang.ClassFormatError: Truncated class file error?
body: <p>I'm trying to use Sublime Text 2 on my Mac in order to write my code for a class I'm taking. I want to test to make sure I can do this first with a basic program, however I'm coming up with an error when I try to run it. I have the build system set to JavaC, and the code is compiling fine, it's just when I try to run it I get issues. Here are my steps:</p>
  
  <pre><code>$ cd Documents/school/algorithms/assignments/
  $ javac Hello.java
  $ java Hello
  
  Exception in thread "main" java.lang.ClassFormatError: Truncated class file
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
  at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  </code></pre>
  
  <p>I've tried to research what this means but I'm coming up short. Here is my code for <code>Hello.java</code></p>
  
  <pre><code>public class Hello {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
  }
  </code></pre>
  
  <p>If anyone can help me with this issue it would be greatly appreciated. Let me know if you need anymore information.</p>