Skip to content

Commit

Permalink
Add required --add-opens server JVM args also with non-embedded JDK
Browse files Browse the repository at this point in the history
Since the Bazel server requires JDK 11 or higher to run, the
`--add-opens` server JVM args can now be added unconditionally.
  • Loading branch information
fmeum committed Nov 9, 2022
1 parent 3e1b5fc commit bec40e7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,12 @@ static vector<string> GetServerExeArgs(const blaze_util::Path &jvm_path,
startup_options.AddJVMArgumentPrefix(jvm_path.GetParent().GetParent(),
&result);

// TODO(b/109998449): only assume JDK >= 9 for embedded JDKs
if (!startup_options.GetEmbeddedJavabase().IsEmpty()) {
// quiet warnings from com.google.protobuf.UnsafeUtil,
// see: https://github.com/google/protobuf/issues/3781
result.push_back("--add-opens=java.base/java.nio=ALL-UNNAMED");
result.push_back("--add-opens=java.base/java.lang=ALL-UNNAMED");
}
// quiet warnings from com.google.protobuf.UnsafeUtil,
// see: https://github.com/google/protobuf/issues/3781
// The Bazel server requires Java 11, so these options are known to be
// supported.
result.push_back("--add-opens=java.base/java.nio=ALL-UNNAMED");
result.push_back("--add-opens=java.base/java.lang=ALL-UNNAMED");

result.push_back("-Xverify:none");

Expand Down

0 comments on commit bec40e7

Please sign in to comment.