Skip to content

Commit

Permalink
[test] jdi: fix .jar ClassPath for I-Build
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T committed Sep 16, 2024
1 parent 026927f commit 618c033
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;

import org.eclipse.debug.jdi.tests.program.MainClass;
import org.eclipse.jdi.Bootstrap;
import org.eclipse.jdi.internal.VirtualMachineImpl;

Expand Down Expand Up @@ -119,7 +121,16 @@ public AbstractJDITest(String name) {
static {
fTargetAddress = System.getProperty("java.home");
fVMLauncherName = "DefaultVMLauncher";
fClassPath = new File("./bin").getAbsolutePath();
try {
String cp = MainClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
System.out.println("MainClass path=" + cp);
if (new File(cp).isDirectory() && !cp.endsWith(File.separatorChar + "/bin/" + File.separatorChar)) {
cp += "bin/" + File.separatorChar;
}
fClassPath = new File(cp).getAbsolutePath();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
fBootPath = "";
fVMType = "?";
}
Expand Down Expand Up @@ -782,7 +793,7 @@ private void launchSunTarget() {
commandLine.add(fBootPath);
}
commandLine.add("-classpath");
commandLine.add(fClassPath);
commandLine.add(fClassPath + "x");
commandLine.add("-Xdebug");
commandLine.add("-Xnoagent");
commandLine.add("-Djava.compiler=NONE");
Expand Down

0 comments on commit 618c033

Please sign in to comment.