Skip to content

Commit 4c9a0c8

Browse files
buchgrCopybara-Service
authored andcommitted
reduce the size of bazel's embedded jdk
The JDK9 compressed binary size increased to ~200MiB from ~85MiB in JDK8. We built a JDK reduced in size to ~50MiB, that still ships with a full set of APIs. See https://docs.google.com/document/d/1Igmv-2GfXkoVFWTXvBYPeniQom8nLAwzqzridDlBIS4 for more details. Commands to build the Linux JDK: curl https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz -o zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz tar -xf zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz cd zulu9.0.7.1-jdk9.0.7-linux_x64/ ./bin/jlink --module-path ./jmods/ --add-modules java.activation,java.base,java.compiler,java.corba,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.prefs,java.rmi,java.scripting,java.se,java.se.ee,java.security.jgss,java.security.sasl,java.smartcardio,java.sql,java.sql.rowset,java.transaction,java.xml,java.xml.bind,java.xml.crypto,java.xml.ws,java.xml.ws.annotation,jdk.accessibility,jdk.aot,jdk.attach,jdk.charsets,jdk.compiler,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.dynalink,jdk.editpad,jdk.hotspot.agent,jdk.httpserver,jdk.incubator.httpclient,jdk.internal.ed,jdk.internal.jvmstat,jdk.internal.le,jdk.internal.opt,jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.jartool,jdk.javadoc,jdk.jcmd,jdk.jconsole,jdk.jdeps,jdk.jdi,jdk.jdwp.agent,jdk.jlink,jdk.jshell,jdk.jsobject,jdk.jstatd,jdk.localedata,jdk.management,jdk.management.agent,jdk.naming.dns,jdk.naming.rmi,jdk.net,jdk.pack,jdk.policytool,jdk.rmic,jdk.scripting.nashorn,jdk.scripting.nashorn.shell,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.xml.bind,jdk.xml.dom,jdk.xml.ws,jdk.zipfs --vm=server --strip-debug --no-man-pages --output zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules cp DISCLAIMER readme.txt zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules/ GZIP=-9 tar -zcf ./zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules RELNOTES: None PiperOrigin-RevId: 202948182
1 parent 95a40be commit 4c9a0c8

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

WORKSPACE

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,31 +117,25 @@ distdir_tar(
117117
# OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.
118118
http_file(
119119
name = "openjdk_linux",
120-
sha256 = "45f2dfbee93b91b1468cf81d843fc6d9a47fef1f831c0b7ceff4f1eb6e6851c8",
120+
sha256 = "f27cb933de4f9e7fe9a703486cf44c84bc8e9f138be0c270c9e5716a32367e87",
121121
urls = [
122-
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
123-
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
124-
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
122+
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz",
125123
],
126124
)
127125

128126
http_file(
129127
name = "openjdk_macos",
130-
sha256 = "5a5b3225b86d3fdb51e9add5335f43cc19c6b2d9b8b5558e72b52d7b2ce9162e",
128+
sha256 = "7a1e769a433948b3d1215911730c17fc2f2710348df18aa966b38c39e4cfe444",
131129
urls = [
132-
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
133-
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
134-
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
130+
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64-allmodules.tar.gz",
135131
],
136132
)
137133

138134
http_file(
139135
name = "openjdk_win",
140-
sha256 = "75f76c53c6a1f12b1a571b86bd9708ab75adf582d689dddc94fdd77dcc0f3f5c",
136+
sha256 = "e738829017f107e7a7cd5069db979398ec3c3f03ef56122f89ba38e7374f63ed",
141137
urls = [
142-
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
143-
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
144-
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
138+
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64-allmodules.zip",
145139
],
146140
)
147141

0 commit comments

Comments
 (0)