Bug 541570 - launch configs of closed projs used in export runnable jar

- in FatJarPackageWizardPage.getLaunchConfigurations(), don't add
  configurations for projects that can't be found or are closed

Change-Id: Id40c95b8f17617cf1fcdddd63b8c94322377b700
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java
index 8f5091e..5e4c26b 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2017 IBM Corporation and others.
+ * Copyright (c) 2007, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -666,7 +666,10 @@
 			for (ILaunchConfiguration launchconfig : manager.getLaunchConfigurations(type)) {
 				if (!launchconfig.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false)) {
 					String projectName= launchconfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
-					result.add(new ExistingLaunchConfigurationElement(launchconfig, projectName));
+					IProject proj= ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+					if (proj != null && proj.isOpen()) {
+						result.add(new ExistingLaunchConfigurationElement(launchconfig, projectName));
+					}
 				}
 			}
 		} catch (CoreException e) {