cfg.setAttribute( "org.eclipse.debug.core.ATTR_REFRESH_SCOPE", "${project}" );
cfg.setAttribute( IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, false );
cfg.setAttribute( "org.eclipse.jdt.launching.MAIN_TYPE", "org.eclipse.ant.internal.launching.remote.InternalAntRunner" );
cfg.setAttribute( "process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory" );
IVMInstall install = null;
for ( IClasspathEntry e : project.getRawClasspath() ) {
String start = e.getPath().segment( 0 );
if ( start.startsWith( "org.eclipse.jdt.launching.JRE_CONTAINER") ) {
install = JavaRuntime.getVMInstall( e.getPath() );
cfg.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, e.getPath().toString() );