title: Compiling Java code in Vim more efficiently
body: <p>I come from an Eclipse background, but I love Vim as a text editor. I'm currently experimenting with Vim as a Java IDE. Currently I do this to compile:</p>
  
  <pre><code>! javac MyClass.java
  </code></pre>
  
  <p>followed by</p>
  
  <pre><code>! java -cp . MyClass
  </code></pre>
  
  <p>If I have compile errors, I have to go back to the compiler output using <code>!</code> and manually jump to every line that produced an error. And as soon as I start adding other classes, I have to compile each of them separately.</p>
  
  <p>There's got to be a more efficient way than this. Under my current inefficient Vim workflow, I can get stuff done faster in a graphical IDE, which beats the purpose of using Vim for me.</p>
  
  <p>I'd like to be able to enter something like <code>:compile</code> in the class containing my main method to compile all my sources and be presented with a split-screen list of error messages. What would you recommend?</p>
  
  <hr>
  
  <p><strong>Related, but not relevant to me personally</strong>:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/253170/tips-for-using-vim-as-a-java-ide">Tips for using vim as a Java IDE?</a></li>
  <li><a href="https://stackoverflow.com/questions/1085146/programming-java-with-vim">Programming Java with Vim</a></li>
  </ul>
  
  <hr>
  
  <p><strong>Update</strong>: My takeaway from this question is posted as a <a href="https://stackoverflow.com/a/14727153/217649">separate answer</a>.</p>