*/
class OsXInstalledJvmLocator {
public Collection<JvmInstallation> findJvms() {
try {
ExecHandleBuilder execHandleBuilder = new ExecHandleBuilder();
execHandleBuilder.workingDir(new File(".").getAbsoluteFile());
execHandleBuilder.commandLine("/usr/libexec/java_home", "-V");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
// verbose output is written to stderr for some reason
execHandleBuilder.setErrorOutput(outputStream);
execHandleBuilder.setStandardOutput(new ByteArrayOutputStream());