Skip to content

Releases: bazelbuild/rules_java

9.3.0

09 Dec 15:53

Choose a tag to compare

Changes since 9.2.0
9d6184b Release rules_java 9.3.0
92f1486 Update to java_tools 18.1
14562f0 Support --library boolean flag for Android Lint in Java rules
2095190 Refer to the SingleJar "executable" instead of "deploy jar."

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.3.0")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.3.0/rules_java-9.3.0.tar.gz",
    ],
    sha256 = "6ef26d4f978e8b4cf5ce1d47532d70cb62cd18431227a1c8007c8f7843243c06",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.2.0

02 Dec 08:55

Choose a tag to compare

Changes since 9.1.0
dbd8cb4 Release rules_java v9.2.0
686ed85 Update to java_tools v18.0
8bf8bca Extract utility methods used in the loading phase from impl/java_helper.bzl into a separate bzl file

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.2.0")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.2.0/rules_java-9.2.0.tar.gz",
    ],
    sha256 = "2f822fbc33b99de5bbeaceada4be2bd3bb5c8da80e2f7462a9d300c8fc312f11",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.1.0

01 Dec 09:20

Choose a tag to compare

Changes since 9.0.3
b685658 Release rules_java v9.1.0
4f806ff Avoid quadratic time on string concatenation in _get_native_deps_helper.
4a9881b remove Bazel 6 branch (#337)
ad7f833 Cleanup unused Bazel 6 test filtering
b5b4100 Prepare to remove _LEGACY_ANY_TYPE_ATTRS workaround in java_toolchain
b55339e Drop support for Bazel 6
e515e2d Fix typo in java_binary.bzl comment.
37b099c Refactor java_single_jar to allow custom output names.
1993657 Enable C++ rules and providers
d4159a2 Fix bazel version check in local_java_repository.bzl
6ea00a4 Internal change

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.1.0")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.1.0/rules_java-9.1.0.tar.gz",
    ],
    sha256 = "4e1a28a25c2efa53500c928d22ceffbc505dd95b335a2d025836a293b592212f",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.0.3

05 Nov 11:40

Choose a tag to compare

Changes since 9.0.2

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.0.3")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.0.3/rules_java-9.0.3.tar.gz",
    ],
    sha256 = "865b3d334bd0f769587737447410d8042d6a95134cc45be5380805fdbacd7152",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.0.2

05 Nov 10:19

Choose a tag to compare

Changes since 9.0.1

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.0.2")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.0.2/rules_java-9.0.2.tar.gz",
    ],
    sha256 = "baf2e93c8190d05e08231fc4b76084f7d85c5d4dc75aa1d2919a3bc4107662cc",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.0.1

05 Nov 09:26

Choose a tag to compare

Changes since 9.0.0
b1376dd Add support for an unstripped bootclasspath

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.0.1")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.0.1/rules_java-9.0.1.tar.gz",
    ],
    sha256 = "6f0afa5f3a3caddbdbb07d1d26330f5a73620d57a5b00cbfced0459806cdaa10",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

9.0.0

04 Nov 14:36

Choose a tag to compare

Changes since 8.16.1
a27004a Update JDKs to latest patch releases (#335)
76212e6 Include the srcjar (if there is one) in the _validation output group so blaze will check whether the srcjar file actually exists.
402b184 upgrade java_tools to 17.0 and wire up linux aarch64 prebuilts (#334)
36264e4 Update zulu JDKs to latest patch release (#327) (#328)
7ff9193 Fix test class determination error message (#326)
1ed307b Increase maxwarns to -1 (#291)
3257e83 Re-enable ReturnValueIgnored error prone check
6a30ab8 Run the bootclasspath through ijar (#324)
3cbc18e Update abseil-cpp to remove override (#322)

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "9.0.0")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/9.0.0/rules_java-9.0.0.tar.gz",
    ],
    sha256 = "19008f8a85125c9476ef37b6ad945f665d7178aaab3746f7962917ccd87d2477",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

8.16.1

23 Sep 13:10

Choose a tag to compare

Changes since 8.16.0
39cae30 Update the compilation JDK to 25 (#323)

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.16.1")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/8.16.1/rules_java-8.16.1.tar.gz",
    ],
    sha256 = "1b30698d89dccd9dc01b1a4ad7e9e5c6e669cdf1918dbb050334e365b40a1b5e",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

8.16.0

23 Sep 10:08

Choose a tag to compare

Changes since 8.15.2
7a625ca Add JDK 25 (#319)
faaab40 Use @bazel_features for rules_java compatibility proxy
4bd56d5 chore: Support remote_file_urls and remote_file_integrity in extension (#315)

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.16.0")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/8.16.0/rules_java-8.16.0.tar.gz",
    ],
    sha256 = "9348e88e93ed882bb79719f082277561a6da967e38db6528bd5c748753f5c651",
)

http_archive(
    name = "bazel_features",
    sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
    strip_prefix = "bazel_features-1.30.0",
    url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.

8.15.2

01 Sep 13:32

Choose a tag to compare

Changes since 8.15.1
52aa53a Add a module extension for registering local/remote jdks (#312)

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.15.2")

WORKSPACE setup

With Bazel 8.0.0 and before 8.3.0, add the following to your file:

# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals

In all cases, add the following to your file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_java",
    urls = [
        "https://github.com/bazelbuild/rules_java/releases/download/8.15.2/rules_java-8.15.2.tar.gz",
    ],
    sha256 = "47632cc506c858011853073449801d648e10483d4b50e080ec2549a4b2398960",
)

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features")  # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")

# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()

Using the rules
See the source.