title: The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (...)
body: <p>Why do I get the following compilation error with a simple call to printf? My code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class TestCodeBankAccInputs
  {
      public static void main(String[] args)
      {
          String displayName = "Bank of America Checking";
          int balance = 100;
          System.out.printf("%s has %7.2f", displayName, balance);
      }
  }
  </code></pre>
  
  <p>On compilation I get the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method printf(String, Object[]) in the type PrintStream is not applicable for the 
      arguments (String, String, double)
    at TestCodeBankAccInputs.main(TestCodeBankAccInputs.java:9)
  </code></pre>
  
  <p>What's causing this and how can I fix it?</p>
  
  <h2>Version information:</h2>
  
  <p>Help->About in Eclipse gives following information:</p>
  
  <p>Eclipse Java EE IDE for Web Developers.</p>
  
  <p>Version: Indigo Release
  Build id: 20110615-0604</p>
  
  <p>The JDK I installed is JDK1.6.0_27</p>
  
  <p>I have seen <a href="https://stackoverflow.com/questions/7701532/string-format-is-not-working">this similar issue regarding String.format</a>. Some users have suggested it might be a build issue, but looks like I have updated versions.</p>