[388537] Jars with Main-class in MANIFEST located in lib dir are
deployed as App clients
diff --git a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
index 5eaec6f..d4a4dc6 100644
--- a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.j2ee; singleton:=true
-Bundle-Version: 1.1.410.qualifier
+Bundle-Version: 1.1.411.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
index 9b79c05..f479b8c 100644
--- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
+++ b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -566,7 +566,7 @@
 				wrapArchive(simpleArchive, new Path(J2EEConstants.WEBAPP_DD_URI));
 				return simpleArchive;
 			} else if (lastSegment.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
-				String libPath = null == archivePath ? null : archivePath.removeLastSegments(1).toPortableString();
+				String libPath = null == archivePath ? null : archivePath.removeLastSegments(1).lastSegment();
 				// Do not look for main class in manifest.mf if jar is on lib directory of EAR 5 or above
 				boolean skipDiscriminateMainClass = isNestedWithinEar5OrAbove && earLibDirectory!= null && earLibDirectory.equals(libPath);
 				Object discriminateMainClass = simpleArchive.getArchiveOptions().getOption(DISCRIMINATE_MAIN_CLASS);