public static List < String > getJreJars ( ) { String javaHome = System . getProperty ( "java.home" ) ; Path libsDir = FileSystems . getDefault ( ) . getPath ( javaHome , "/lib" ) ; List < String > retval = GosucUtil . getIbmClasspath ( ) ; try { retval . addAll ( Files . walk ( libsDir ) . filter ( path -> path . toFile ( ) . isFile ( ) ) . filter ( path -> path . toString ( ) . endsWith ( ".jar" ) ) . map ( Path :: toString ) . collect ( Collectors . toList ( ) ) ) ; } catch ( SecurityException | IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } return retval ; }
Get all JARs from the lib directory of the System s java . home property