very attentive :) isn't this supposed to be `file://` (note the double slash?) (I keep forgetting that this syntax exists) No, the syntax is, apparently, file:(path), where path can be relative to the current directory or absolute. This matches the previous implementation. Me too.
java_stub_template improperly qualifies paths
In [java_stub_template.txt](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt;drc=02f8da948bf3955304a4cef9399bd3907430bbc4;l=298), when building the classpath for the manifest file, every path entry is first qualified with the working directory, even when the path is already an absolute path.

The code should check for relative paths before qualifying them.
src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
index 1aac7f8c90c131..41b3362ba863f6 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
@@ -288,28 +288,41 @@ ARGS=(
 
 
 function create_and_run_classpath_jar() {
-  # Build class path as one single string separated by spaces
-  MANIFEST_CLASSPATH=""
+  # Build class path.
+  MANIFEST_CLASSPATH=()
   if is_windows; then
     CLASSPATH_SEPARATOR=";"
-    URI_PREFIX="file:/"  # e.g. "file:/C:/temp/foo.jar"
   else
     CLASSPATH_SEPARATOR=":"
-    URI_PREFIX="file:$(pwd)/"  # e.g. "file:/usr/local/foo.jar"
   fi
 
-  URI_PREFIX=${URI_PREFIX//\//\\/}
-  MANIFEST_CLASSPATH="${CLASSPATH_SEPARATOR}${CLASSPATH}"
+  OLDIFS="$IFS"
+  IFS="${CLASSPATH_SEPARATOR}" # Use a custom separator for the loop.
+  for path in ${CLASSPATH}; do
+    # Convert spaces to %20
 
-  MANIFEST_CLASSPATH=$(sed "s/ /%20/g" <<< "${MANIFEST_CLASSPATH}")
-  MANIFEST_CLASSPATH=$(sed "s/$CLASSPATH_SEPARATOR/ $URI_PREFIX/g" <<< "${MANIFEST_CLASSPATH}")
+    if is_windows; then
+      path="file:/${path}" # e.g. "file:/C:/temp/foo.jar"
+    else
+      # If not absolute, qualify the path
+      case "${path}" in
+        /*) ;; # Already an absolute path
+        *) path="$(pwd)/${path}";; # Now qualified
+      esac
+      path="file:${path}" # e.g. "file:/usr/local/foo.jar"
+    fi
+
+    path=$(sed "s/ /%20/g" <<< "${path}")
+    MANIFEST_CLASSPATH+=("${path}")
+  done
+  IFS="$OLDIFS"
 
   # Create manifest file
   MANIFEST_FILE="$(mktemp -t XXXXXXXX.jar_manifest)"
   (
     echo "Manifest-Version: 1.0"
 
-    CLASSPATH_LINE="Class-Path:$MANIFEST_CLASSPATH"
+    CLASSPATH_LINE="Class-Path: ${MANIFEST_CLASSPATH[*]}"
     CLASSPATH_MANIFEST_LINES=$(sed -E $'s/(.{71})/\\1\\\n /g' <<< "${CLASSPATH_LINE}")
 
     echo "$CLASSPATH_MANIFEST_LINES"
