diff options
Diffstat (limited to 'src')
2 files changed, 7 insertions, 2 deletions
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java index 20b8689392..d422cd39ea 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java @@ -210,7 +210,7 @@ public class BlazeJavacMain { } fileManager.setLocationFromPaths(StandardLocation.SOURCE_PATH, sourcePath); - // TODO(cushon): require an explicit bootclasspath + // The bootclasspath may legitimately be empty if --release is being used. Collection<Path> bootClassPath = arguments.bootClassPath(); if (!bootClassPath.isEmpty()) { fileManager.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, bootClassPath); diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java index f88b1a71f0..3ee4d204c0 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java @@ -40,6 +40,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; +import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Locale; @@ -85,7 +86,11 @@ public class JavacTurbineCompiler { fm.setContext(context); fm.setLocationFromPaths(StandardLocation.SOURCE_PATH, Collections.<Path>emptyList()); fm.setLocationFromPaths(StandardLocation.CLASS_PATH, request.classPath()); - fm.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, request.bootClassPath()); + // The bootclasspath may legitimately be empty if --release is being used. + Collection<Path> bootClassPath = request.bootClassPath(); + if (!bootClassPath.isEmpty()) { + fm.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, bootClassPath); + } fm.setLocationFromPaths( StandardLocation.ANNOTATION_PROCESSOR_PATH, request.processorClassPath()); fm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, ImmutableList.of(classes)); |