code: public static boolean jreFile(final File file) {
          final String javaHome = System.getProperty("java.home");
          try {
              return file.getCanonicalPath().startsWith(javaHome) && file.isFile();
          } catch (final IOException ex) {
              throw new RuntimeException("Error reading canonical path for: " + file, ex);
          }
      }
docs: Determines if the file is a file from the Java runtime and exists.
  
  @param file
  File to test.
  
  @return TRUE if the file is in the 'java.home' directory.