Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #199 from asaenf/asaenf-patch-1
Browse files Browse the repository at this point in the history
Use absolute classpath as input
  • Loading branch information
honnix authored Dec 11, 2018
2 parents 09fe382 + 24b7b64 commit 27303c0
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import com.spotify.flo.Fn;
import com.spotify.flo.Serialization;
import com.spotify.flo.SerializationException;
import com.spotify.flo.freezer.PersistingContext;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand All @@ -48,6 +48,7 @@
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -135,9 +136,14 @@ void start() {
} catch (SerializationException e) {
throw new RuntimeException("Failed to serialize closure", e);
}

final ProcessBuilder processBuilder = new ProcessBuilder(java.toString(), "-cp", classPath)
.directory(workdir.toFile());

final String absoluteClassPath =
Arrays.stream(classPath.split(File.pathSeparator))
.map(cp -> Paths.get(cp).toAbsolutePath().toString())
.collect(Collectors.joining(File.pathSeparator));

final ProcessBuilder processBuilder =
new ProcessBuilder(java.toString(), "-cp", absoluteClassPath).directory(workdir.toFile());

// Propagate -Xmx and -D.
// Note: This is suboptimal because if the user has configured a max heap size we will effectively use that
Expand Down

0 comments on commit 27303c0

Please sign in to comment.