title: Vim: running java from vim command gives error
body: <p>I wrote a simple hello world program to test the JDK installation.  I can compile from Vim using:</p>
  
  <pre><code>:!javac Desktop\HelloWorld.java
  </code></pre>
  
  <p>That works just fine but when I try to run the program using:</p>
  
  <pre><code>:!java Desktop\HelloWorld
  </code></pre>
  
  <p>it gives me this error:</p>
  
  <blockquote>
  C:\Windows\system32\cmd.exe /c java "Desktop\HelloWorld"
  Exception in thread "main" java.lang.NoClassDefFoundError: Desktop\HelloWorld (w
  rong name: HelloWorld)
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(Unknown Source)
          at java.security.SecureClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.access$000(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClassInternal(Unknown Source)
  Could not find the main class: Desktop\HelloWorld.  Program will exit.
  </blockquote>
  
  <p>The program works just fine from the normal command line.</p>
  
  <pre><code>C:\Users\Casey\Desktop&gt;java HelloWorld
  Hello world!
  </code></pre>
  
  <p>How can I execute the program from Vim without having to switch to the standard cmd?</p>