Skip to content

Commit

Permalink
Include also ext jars in the bootclasspath jar.
Browse files Browse the repository at this point in the history
Fixes #6060.

RELNOTES: None.
PiperOrigin-RevId: 212493359
  • Loading branch information
lberki authored and Copybara-Service committed Sep 11, 2018
1 parent e632d50 commit 2834613
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions tools/jdk/DumpPlatformClassPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
Expand Down Expand Up @@ -71,12 +73,29 @@ public static void main(String[] args) throws Exception {
if (javaHome.endsWith("jre")) {
javaHome = javaHome.getParent();
}
for (String jar :
Arrays.asList("rt.jar", "resources.jar", "jsse.jar", "jce.jar", "charsets.jar")) {

List<Path> jars = new ArrayList<>();

Path extDir = javaHome.resolve("jre/lib/ext");
if (Files.exists(extDir)) {
for (Path extJar : Files.newDirectoryStream(extDir, "*.jar")) {
jars.add(extJar);
}
}

for (String jar : Arrays.asList(
"rt.jar",
"resources.jar",
"jsse.jar",
"jce.jar",
"charsets.jar")) {
Path path = javaHome.resolve("jre/lib").resolve(jar);
if (!Files.exists(path)) {
continue;
if (Files.exists(path)) {
jars.add(path);
}
}

for (Path path : jars) {
try (JarFile jf = new JarFile(path.toFile())) {
jf.stream()
.forEachOrdered(
Expand Down

0 comments on commit 2834613

Please sign in to comment.