Skip to content

Commit

Permalink
AwtScreenshot: Do not add "bin" to classpath eclipse-platform#1486
Browse files Browse the repository at this point in the history
for "Eclipse-BundleShape: dir" in MANIFEST.MF

fix "Error: Could not find or load main class
org.eclipse.test.AwtScreenshot"

eclipse-platform/eclipse.platform.swt#1486
  • Loading branch information
EcljpseB0T committed Oct 7, 2024
1 parent a1d3873 commit 447290a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public static void dumpAwtScreenshot(String screenshotFile) {
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)) {
if (new File(cp).isDirectory() && !cp.endsWith(File.separatorChar + "bin" + File.separatorChar)
&& new File(cp + "bin" + File.separatorChar).isDirectory()) {
cp += "bin" + File.separatorChar;
}
String javaHome = System.getProperty("java.home");
Expand Down Expand Up @@ -120,11 +121,13 @@ public static void dumpAwtScreenshot(String screenshotFile) {
if (done) {
int exitCode = process.exitValue();
if (exitCode != 0) {
System.out.println("AwtScreenshot VM finished with exit code " + exitCode + ".");
new RuntimeException("AwtScreenshot VM finished with exit code " + exitCode + ".")
.printStackTrace();
}
} else {
process.destroy();
System.out.println("Killed AwtScreenshot VM after " + TIMEOUT_SECONDS + " seconds.");
new RuntimeException("Killed AwtScreenshot VM after " + TIMEOUT_SECONDS + " seconds.")
.printStackTrace();
}
} catch (URISyntaxException | IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit 447290a

Please sign in to comment.