Index: macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java,v retrieving revision 1.12 diff -u -r1.12 MacOSXLaunchingPlugin.java --- macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java 10 Mar 2003 21:56:05 -0000 1.12 +++ macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXLaunchingPlugin.java 14 Mar 2003 12:18:00 -0000 @@ -86,8 +86,10 @@ * the stub either from the running Eclipse or from the JavaVM * framework. Here we create the appropriate pathname. */ + int pos= 0; String javaApplStub= System.getProperty("sun.boot.library.path"); //$NON-NLS-1$ - int pos= javaApplStub.indexOf(':'); + if (javaApplStub != null) + pos= javaApplStub.indexOf(':'); if (pos > 0) javaApplStub= javaApplStub.substring(0, pos); String expected= "/Contents/Resources/Java"; //$NON-NLS-1$ @@ -95,7 +97,18 @@ javaApplStub= javaApplStub.substring(0, javaApplStub.length()-expected.length()); javaApplStub+= "/Contents/MacOS/"; //$NON-NLS-1$ } else { - javaApplStub= "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/"; //$NON-NLS-1$ + javaApplStub= System.getProperty("java.class.path"); //$NON-NLS-1$ + if (javaApplStub != null) + pos= javaApplStub.indexOf(expected); + else + pos= 0; + if (pos > 0) { + javaApplStub= javaApplStub.substring(0, pos); + javaApplStub+= "/Contents/MacOS/"; //$NON-NLS-1$ + } else { + // fall back + javaApplStub= "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/"; //$NON-NLS-1$ + } } javaApplStub= "JAVASTUB=\""+ javaApplStub + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$