public static List<String> findJarsInDir(ResourceFile dir) {
		Set<ResourceFile> set = new TreeSet<>((a, b) -> a.getName().compareTo(b.getName()));
		ResourceFile[] names = dir.listFiles();
		if (names != null) {
			for (ResourceFile file : names) {
				if (file.getName().endsWith(".jar")) {
					set.add(file);
				}
			}
		}
		return set.stream().map(f -> f.getAbsolutePath()).collect(Collectors.toList());
	}
Searches the given directory (non-recursively) for jars and returns their paths in a list.
The paths will be sorted by jar file name.

@param dir The directory to search for jars in
@return A list of discovered jar paths, sorted by jar file name
Ghidra/Framework/Utility/src/main/java/ghidra/GhidraLauncher.java