diff --git a/.bazelrc b/.bazelrc index e02e83d0858..485f3ce2d05 100644 --- a/.bazelrc +++ b/.bazelrc @@ -24,7 +24,7 @@ build --java_runtime_version=remotejdk_18 build --tool_java_runtime_version=remotejdk_18 # Default source/target versions. -build --javacopt="-source 8 -target 8" +build --javacopt="--release 8" # Workaround for https://openjdk.java.net/jeps/411. # See https://github.com/bazelbuild/bazel/issues/14502#issuecomment-1018366245. diff --git a/build_defs.bzl b/build_defs.bzl index 3dd0647ca89..6f56ff44512 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -18,6 +18,6 @@ DOCLINT_HTML_AND_SYNTAX = ["-Xdoclint:html,syntax"] DOCLINT_REFERENCES = ["-Xdoclint:reference"] -JAVA_RELEASE_MIN = ["-source 8 -target 8"] +JAVA_RELEASE_MIN = ["--release 8"] POM_VERSION = "${project.version}"