From c6e3124de2f37a1949f7cca54a37e2846a4a3fd4 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Mon, 18 Dec 2023 02:54:34 +0100 Subject: [PATCH] correct bug about path formatting in windows --- .../tensorflow/v2/api020/Tensorflow2Interface.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/Tensorflow2Interface.java b/src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/Tensorflow2Interface.java index 84d86d7..f2b1454 100644 --- a/src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/Tensorflow2Interface.java +++ b/src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/Tensorflow2Interface.java @@ -682,11 +682,12 @@ private List getProcessCommandsWithoutArgs() throws IOException, URISynt ProtectionDomain protectionDomain = Tensorflow2Interface.class.getProtectionDomain(); String codeSource = protectionDomain.getCodeSource().getLocation().getPath(); String f_name = URLDecoder.decode(codeSource, StandardCharsets.UTF_8.toString()); - for (File ff : new File(f_name).getParentFile().listFiles()) { - if (ff.getName().startsWith(JAR_FILE_NAME) && !ff.getAbsolutePath().equals(f_name)) - continue; - classpath += ff.getAbsolutePath() + File.pathSeparator; - } + f_name = new File(f_name).getAbsolutePath(); + for (File ff : new File(f_name).getParentFile().listFiles()) { + if (ff.getName().startsWith(JAR_FILE_NAME) && !ff.getAbsolutePath().equals(f_name)) + continue; + classpath += ff.getAbsolutePath() + File.pathSeparator; + } String className = Tensorflow2Interface.class.getName(); List command = new LinkedList(); command.add(padSpecialJavaBin(javaBin));