Bug 573865 - [launch] renaming a JRE adds a trailing slash after the
name in run configurations

Change-Id: Ibb7fd00b5a1d5c0fd4a3fb13a44fc37c35b80d31
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/181347
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Sarika Sinha <sarika.sinha@in.ibm.com>
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
index 29359ff..f271742 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -215,7 +215,7 @@
 			IPath containerPath = fJREBlock.getPath();
 			String portablePath = null;
 			if (containerPath != null) {
-				portablePath = containerPath.toPortableString();
+				portablePath = containerPath.addTrailingSeparator().toPortableString();
 			}
 			configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, portablePath);
 		}