Skip to content

Broken local Java version detection #170

@bertschneider

Description

@bertschneider

The current local Java version detection in _detect_java_version may return None, which in turn breaks further processing in _local_java_repository_impl.

I encountered this problem due to a broken local Java installation, which was not able to execute java -XshowSettings:properties to begin with.

Error message:

ERROR: <builtin>: fetching _local_java_repository_rule rule //:rules_java~7.3.2~toolchains~local_jdk: Traceback (most recent call last):
    File "/private/var/tmp/_bazel_administrator/02bc2c2b51523be4b85c9cb7f6299f33/external/rules_java~7.3.2/toolchains/local_java_repository.bzl", line 217, column 72, in _local_java_repository_impl
        build_file = build_file.format(RUNTIME_VERSION = version if version.isdigit() else "0")
Error: 'NoneType' value has no field or method 'isdigit'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions