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 1df9875
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit 1df9875

Please sign in to comment.