File () { File home = myLocation; if (SystemInfo.isMac) { File contents = new File(home, "Contents/Home"); if (contents.isDirectory()) { home = contents; } } File javaPath = new File(home, SystemInfo.isWindows ? "bin\\java.exe" : "bin/java"); if (!javaPath.isFile()) { javaPath = new File(home, SystemInfo.isWindows ? "jre\\bin\\java.exe" : "jre/bin/java"); } return javaPath; }