public static String [ ] getJars ( ) { final ArrayList < String > list = new ArrayList <> ( ) ; final FileExtFileFilter filter = new FileExtFileFilter ( JAR_EXT ) ; for ( final String part : System . getProperty ( CLASSPATH ) . split ( File . pathSeparator ) ) { final File file = new File ( part ) ; if ( filter . accept ( file . getParentFile ( ) , file . getName ( ) ) ) { list . add ( file . getAbsolutePath ( ) ) ; } } return list . toArray ( new String [ 0 ] ) ; }
Returns an String array of all the names of the jars in the system classpath