Snippet The key here is to use the system property java.version and get minor and point version.  
  1. public class CheckVersion {
  2.   public static void main(String[] args) {
  3.     String version = System.getProperty("java.version");
  4.     char minor = version.charAt(2);
  5.     char point = version.charAt(4);
  6.     if(minor < '4' || point < '1')
  7.       thrownew RuntimeException("JDK 1.4.1 or higher " +
  8.         "is required run this app");
  9.     System.out.println("JDK version "+ version + " found");
  10.   }