public static String findJavaExecutableForEclipse() throws CoreException {
  String javaHomeProp=System.getProperty("java.home");
  File javaHomeDir=null;
  if (javaHomeProp != null) {
    javaHomeDir=new File(javaHomeProp);
  }
  if (javaHomeDir == null || !javaHomeDir.exists()) {
    throw new CoreException(new Status(Status.ERROR,CorePlugin.PLUGIN_ID,"Cannot read the java.home property - unable detect the JVM that Eclipse is running on."));
  }
  File javaExecutable=StandardVMType.findJavaExecutable(javaHomeDir);
  if (javaExecutable == null || !javaExecutable.exists()) {
    throw new CoreException(new Status(Status.ERROR,CorePlugin.PLUGIN_ID,"Unable to find a java executable for the JVM that Eclipse is running on (located at " + javaHomeDir.getAbsolutePath() + "). Please verify that this JVM is installed properly."));
  }
  return javaExecutable.getAbsolutePath();
}

public static String findJavaExecutableForEclipse ( ) throws CoreException { String javaHomeProp = System . getProperty ( "java.home" ) ; File javaHomeDir = null ; if ( javaHomeProp != null ) { javaHomeDir = new File ( javaHomeProp ) ; } if ( javaHomeDir == null || ! javaHomeDir . exists ( ) ) { throw new CoreException ( new Status ( Status . ERROR , CorePlugin . PLUGIN_ID , "Cannot read the java.home property - unable detect the JVM that Eclipse is running on." ) ) ; } File javaExecutable = StandardVMType . findJavaExecutable ( javaHomeDir ) ; if ( javaExecutable == null || ! javaExecutable . exists ( ) ) { throw new CoreException ( new Status ( Status . ERROR , CorePlugin . PLUGIN_ID , "Unable to find a java executable for the JVM that Eclipse is running on (located at " + javaHomeDir . getAbsolutePath ( ) + "). Please verify that this JVM is installed properly." ) ) ; } return javaExecutable . getAbsolutePath ( ) ; }
return the path to the java executable for eclipse ' s jvm .
