Similar for loop exists in the run script, for pyspark for example. Also, this method does not search for subdirectories recursively (http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html). So even though it may generate a long jar list, this will catch all JAR files in lib without missing anything AND without specifying each directory manually.

In this particular case, since there is just one Jar file (kafka), its fine to leave it as it is. Its unlikely that any other jar is going to be added. In the event it does happen, this format will automatically catch that JAR as well without any other changes.