17
17
18
18
import java .io .File ;
19
19
import java .io .IOException ;
20
+ import java .nio .file .FileSystems ;
20
21
import java .nio .file .FileVisitOption ;
21
22
import java .nio .file .Files ;
22
23
import java .nio .file .Path ;
@@ -44,9 +45,11 @@ public static String getImageJClassPaths() {
44
45
String classPaths = "" ;
45
46
46
47
if (System .getProperty ("imagej.dir" ) != null ) {
47
- classPaths += Paths .get (System .getProperty ("imagej.dir" ), "jars" , "*" ) + ":" ;
48
- classPaths += Paths .get (System .getProperty ("imagej.dir" ), "jars" , "bio-formats" , "*" ) + ":" ;
49
- classPaths += Paths .get (System .getProperty ("imagej.dir" ), "plugins" , "*" ) + ":" ;
48
+
49
+ String classPathSeparator = SystemUtil .getClassPathSeparator ();
50
+ classPaths += Paths .get (System .getProperty ("imagej.dir" ), "jars" ) + FileSystems .getDefault ().getSeparator () + "*" + classPathSeparator ;
51
+ classPaths += Paths .get (System .getProperty ("imagej.dir" ), "jars" , "bio-formats" ) + FileSystems .getDefault ().getSeparator () + "*" + classPathSeparator ;
52
+ classPaths += Paths .get (System .getProperty ("imagej.dir" ), "plugins" ) + FileSystems .getDefault ().getSeparator () + "*" + classPathSeparator ;
50
53
}
51
54
52
55
return classPaths ;
@@ -65,4 +68,14 @@ public static void deleteFolderRecursively(Path rootPath, LogService log) {
65
68
}
66
69
}
67
70
71
+ public static String getClassPathSeparator () {
72
+ String classPathSeparator ;
73
+ if (System .getProperty ("os.name" ).toLowerCase ().contains ("windows" )) {
74
+ classPathSeparator = ";" ;
75
+ } else {
76
+ classPathSeparator = ":" ;
77
+ }
78
+ return classPathSeparator ;
79
+ }
80
+
68
81
}
0 commit comments