String () { final File brewDir = new File("/usr/local/Cellar/maven"); final String[] list = brewDir.list(); if (list == null || list.length == 0) return null; Arrays.sort(list, (o1, o2) -> compareVersionNumbers(o2, o1)); return brewDir + File.separator + list[0] + "/libexec"; }