diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java index c7b3ad4c124..8c8f71baa11 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java @@ -282,11 +282,13 @@ public class CMainTab extends CLaunchConfigurationTab { setMessage(null); String name = fProjText.getText().trim(); - if (name.length() > 0) { - if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { - setErrorMessage("Project does not exist"); - return false; - } + if (name.length() == 0) { + setErrorMessage("Project not specified"); + return false; + } + if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { + setErrorMessage("Project does not exist"); + return false; } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); @@ -295,10 +297,7 @@ public class CMainTab extends CLaunchConfigurationTab { setErrorMessage("Program not specified"); return false; } - IPath path = Platform.getLocation().append(project.getFullPath()); - path = path.append(name); - - if (!ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path).exists()) { + if (!project.getFile(name).exists() ) { setErrorMessage("Program does not exist"); return false; }