@@ -383,18 +383,29 @@ public static File findExecutable() throws IOException {
383383 }
384384 }
385385 }
386-
386+ if (Platform .OS_MACOSX .equals (Platform .getOS ())) {
387+ // After https://bugs.eclipse.org/431116 and related changes, the install
388+ // location on the Mac
389+ // moved down two directories (from <folder-containing-Eclipse.app> to
390+ // Eclipse.app/Contents/Eclipse).
391+ baseLocation = baseLocation .getParentFile ().getParentFile ();
392+ }
393+ File fallback1 = new File (baseLocation .getParentFile (), "deltapack/eclipse" );
394+ executableLocation = findExecutable (fallback1 );
395+ if (executableLocation != null ) {
396+ return executableLocation ;
397+ }
387398 if (Platform .OS .isMac ()) {
388399 // After https://bugs.eclipse.org/431116 and related changes, the install
389400 // location on the Mac
390401 // moved down two directories (from <folder-containing-Eclipse.app> to
391402 // Eclipse.app/Contents/Eclipse).
392- baseLocation = baseLocation .getParentFile (). getParentFile (). getParentFile () ;
403+ baseLocation = baseLocation .getParentFile ();
393404 }
394- File fallback = new File (baseLocation .getParentFile ().getParentFile (), "deltapack/eclipse" );
395- executableLocation = findExecutable (fallback );
396- assertNotNull ("All attempts to find the executable failed including fallback to " + fallback .getAbsolutePath (),
397- executableLocation );
405+ File fallback2 = new File (baseLocation .getParentFile ().getParentFile (), "deltapack/eclipse" );
406+ executableLocation = findExecutable (fallback2 );
407+ assertNotNull ("All attempts to find the executable failed including fallback to " + fallback1 .getAbsolutePath ()
408+ + " or to " + fallback2 . getAbsolutePath (), executableLocation );
398409 return executableLocation ;
399410 }
400411
0 commit comments