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 ) ; } }
Determines if the file is a file from the Java runtime and exists .