Bug 520012: Screenshots.takeScreenshot fails due to classpath error

Append bin/ to the classpath, so that the correct classpath is passed to
the ProcessBuilder


Change-Id: Ib423a4fb4ce9b50b669da138742935ecb5d9694a
Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
diff --git a/bundles/org.eclipse.test.performance/src/org/eclipse/test/internal/AwtScreenshot.java b/bundles/org.eclipse.test.performance/src/org/eclipse/test/internal/AwtScreenshot.java
index e8011dc..1ee8556 100644
--- a/bundles/org.eclipse.test.performance/src/org/eclipse/test/internal/AwtScreenshot.java
+++ b/bundles/org.eclipse.test.performance/src/org/eclipse/test/internal/AwtScreenshot.java
@@ -79,6 +79,9 @@
         try {
             URL location = AwtScreenshot.class.getProtectionDomain().getCodeSource().getLocation();
             String cp = location.toURI().getPath();
+            if (new File(cp).isDirectory() && !cp.endsWith(File.separatorChar + "bin" + File.separatorChar)) {
+                cp += "bin" + File.separatorChar;
+            }
             String javaHome = System.getProperty("java.home");
             String javaExe = javaHome + File.separatorChar + "bin" + File.separatorChar + "java";
             if (File.separatorChar == '\\') {