Bug 88697 - [jars] Permissions not copied when extracting library from JARs
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java
index 733e83e..1dec6c2 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java
@@ -153,6 +153,15 @@
 				//						debug("found " + path + " as " +
 				// variants[i] + path); //$NON-NLS-1$ //$NON-NLS-2$
 				File libFile = baseBundleFile.getFile(variants[i] + path);
+				// see bug 88697 - HP requires libraries to have executable permissions
+				if (org.eclipse.osgi.service.environment.Constants.OS_HPUX.equals(EnvironmentInfo.getDefault().getOS())) {
+					try {
+						// use the string array method in case there is a space in the path
+						Runtime.getRuntime().exec(new String[] {"chmod", "755", libFile.getAbsolutePath()}).waitFor();
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+				}
 				return libFile.getAbsolutePath();
 			}
 		}