Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that Java language level isn't higher than runtime version #18340

Closed
wants to merge 1 commit into from

Commits on May 8, 2023

  1. Verify that Java language level isn't higher than runtime version

    The value of `--(tool_)java_language_version` results in a matching
    `-target` argument passed to javac and thus in the generation of class
    files that only run on runtimes of the same or higher versions.
    
    This commit introduces a check that fails if the language version is
    strictly higher than the version of the current runtime. In the exec
    configuration, this covers two situations at once:
    * Compilation of a Java tool, where the runtime version is determined
      by `--tool_java_runtime_version`.
    * Compilation with a `java_plugin`, where the runtime version is
      determined by the `java_runtime_version_alias` target specified as the
      Java toolchain's `java_runtime`.
    
    The latter situation led to especially confusing error messages when
    the `--tool_java_language_level` was higher than the version of the
    runtime used for Java compilation.
    fmeum committed May 8, 2023
    Configuration menu
    Copy the full SHA
    2e00179 View commit details
    Browse the repository at this point in the history