Skip to content

Commit 154dfc5

Browse files
committed
FIX: app run not working on Windows #115
1 parent 710f27e commit 154dfc5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

restx-core/src/main/java/restx/Apps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.base.Optional;
44
import com.google.common.base.Splitter;
5+
import com.google.common.base.StandardSystemProperty;
56
import com.google.common.collect.ImmutableList;
67
import com.google.common.eventbus.EventBus;
78
import com.google.common.eventbus.Subscribe;
@@ -29,6 +30,7 @@
2930
*/
3031
public class Apps {
3132
private static final Logger logger = LoggerFactory.getLogger(Apps.class);
33+
private static final String PATH_SEP = StandardSystemProperty.PATH_SEPARATOR.value();
3234

3335
public static Apps with(AppSettings appSettings) {
3436
return new Apps(appSettings);
@@ -106,10 +108,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
106108

107109
public Process run(File workingDirectory, Path targetClasses, Path dependenciesDir, List<String> vmOptions,
108110
String mainClassName, List<String> args, boolean quiet) throws IOException {
109-
String classpath = targetClasses.toString() + ":" + dependenciesDir.toString() + "/*";
111+
String classpath = targetClasses.toString() + PATH_SEP + dependenciesDir.toString() + "/*";
110112
File toolsJar = new File(System.getenv("JAVA_HOME") + "/lib/tools.jar");
111113
if (toolsJar.exists()) {
112-
classpath += ":" + toolsJar.getAbsolutePath();
114+
classpath += PATH_SEP + toolsJar.getAbsolutePath();
113115
}
114116

115117
final Process process = new ProcessBuilder(

0 commit comments

Comments
 (0)