static String getClasspathClassFileNames ( ) { String classpath = System . getProperty ( "java.class.path" ) ; String [ ] pathParts = classpath . split ( File . pathSeparator ) ; Set < String > classes = new TreeSet < String > ( ) ; for ( String part : pathParts ) { processPathPart ( part , classes ) ; } StringBuilder sb = new StringBuilder ( ) ; for ( String className : classes ) { sb . append ( className ) . append ( ' ' ) ; } return sb . toString ( ) ; }
Get a single string that contains all of the non - jar classfiles in the current classpath separated by newlines . Classfiles are represented by their Java dot names not filenames .