Skip to content

Commit 229b5d6

Browse files
committed
correct bug about path formatting in windows
1 parent db79e13 commit 229b5d6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/io/bioimage/modelrunner/tensorflow/v2/api050/Tensorflow2Interface.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,12 @@ private List<String> getProcessCommandsWithoutArgs() throws IOException, URISynt
687687
ProtectionDomain protectionDomain = Tensorflow2Interface.class.getProtectionDomain();
688688
String codeSource = protectionDomain.getCodeSource().getLocation().getPath();
689689
String f_name = URLDecoder.decode(codeSource, StandardCharsets.UTF_8.toString());
690-
for (File ff : new File(f_name).getParentFile().listFiles()) {
691-
if (ff.getName().startsWith(JAR_FILE_NAME) && !ff.getAbsolutePath().equals(f_name))
692-
continue;
693-
classpath += ff.getAbsolutePath() + File.pathSeparator;
694-
}
690+
f_name = new File(f_name).getAbsolutePath();
691+
for (File ff : new File(f_name).getParentFile().listFiles()) {
692+
if (ff.getName().startsWith(JAR_FILE_NAME) && !ff.getAbsolutePath().equals(f_name))
693+
continue;
694+
classpath += ff.getAbsolutePath() + File.pathSeparator;
695+
}
695696
String className = Tensorflow2Interface.class.getName();
696697
List<String> command = new LinkedList<String>();
697698
command.add(padSpecialJavaBin(javaBin));

0 commit comments

Comments
 (0)