Skip to content

Commit 072c21b

Browse files
author
jossonsmith
committed
To calculate relative path using current project's absolute output location
1 parent 7a011f0 commit 072c21b

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SLaunchingUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,12 @@ private static String generateClasspathExistedClasses (
293293
}
294294

295295
buf.append('[');
296-
buf.append(relativePath);
296+
try {
297+
buf.append(new File(workingDir, relativePath).getCanonicalPath());
298+
} catch (IOException e) {
299+
e.printStackTrace();
300+
buf.append(relativePath);
301+
}
297302
buf.append("],");
298303
String classpath = configuration.getAttribute(IJ2SLauchingConfiguration.J2S_CLASS_PATH, (String) null);
299304
if (classpath == null || classpath.trim().length() == 0) {

sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SUnitLaunchingUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ private static String generateClasspathExistedClasses (
291291
}
292292

293293
buf.append('[');
294-
buf.append(relativePath);
294+
try {
295+
buf.append(new File(workingDir, relativePath).getCanonicalPath());
296+
} catch (IOException e) {
297+
e.printStackTrace();
298+
buf.append(relativePath);
299+
}
295300
buf.append("],");
296301
String classpath = configuration.getAttribute(IJ2SLauchingConfiguration.J2S_CLASS_PATH, (String) null);
297302
if (classpath == null || classpath.trim().length() == 0) {

0 commit comments

Comments
 (0)