title: Getting Java version at runtime
body: <p>I need to work around a Java bug in JDK 1.5 which was fixed in 1.6. I'm using the following condition:</p>
  
  <pre><code>if (System.getProperty("java.version").startsWith("1.5.")) {
      ...
  } else {
      ...
  }
  </code></pre>
  
  <p>Will this work for other JVMs? Is there a better way to check this?</p>