diff --git a/sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/DataflowPipelineRunner.java b/sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/DataflowPipelineRunner.java index e7589bfef4..9927919cc4 100644 --- a/sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/DataflowPipelineRunner.java +++ b/sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/DataflowPipelineRunner.java @@ -136,6 +136,8 @@ import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Optional; +import com.google.common.base.Splitter; +import com.google.common.base.StandardSystemProperty; import com.google.common.base.Strings; import com.google.common.base.Utf8; import com.google.common.collect.ForwardingMap; @@ -3198,6 +3200,10 @@ public String toString() { * @return A list of absolute paths to the resources the class loader uses. */ protected static List detectClassPathResourcesToStage(ClassLoader classLoader) { + if (classLoader == ClassLoader.getSystemClassLoader()) { + return Splitter.on(File.pathSeparatorChar) + .splitToList(StandardSystemProperty.JAVA_CLASS_PATH.value()); + } if (!(classLoader instanceof URLClassLoader)) { String message = String.format("Unable to use ClassLoader to detect classpath elements. " + "Current ClassLoader is %s, only URLClassLoaders are supported.", classLoader);