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

Build failure on Linux system with JDK 22-ea installed: Error in int: invalid base-10 literal: "22-ea" #1068

Closed
yesudeep opened this issue Mar 14, 2024 · 1 comment

Comments

@yesudeep
Copy link
Contributor

yesudeep commented Mar 14, 2024

Hello,

My system version of the JDK upgraded to 22-ea on Fedora Linux 39 (Workstation Edition), and that appears to break rules_jvm_external.

zsh❯ java --version
openjdk 22-ea 2024-03-19
OpenJDK Runtime Environment (Red_Hat-22.0.0.0.36-1) (build 22-ea+36)
OpenJDK 64-Bit Server VM (Red_Hat-22.0.0.0.36-1) (build 22-ea+36, mixed mode, sharing)

zsh❯ which java
/usr/lib/jvm/java-22-openjdk/bin/java

Here is the error:

ERROR: An error occurred during the fetch of repository 'maven':
   Traceback (most recent call last):
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/coursier.bzl", line 949, column 38, in _coursier_fetch_impl
                dep_tree = make_coursier_dep_tree(
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/coursier.bzl", line 853, column 30, in make_coursier_dep_tree
                if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/private/java_utilities.bzl", line 21, column 19, in parse_java_version
                return int(java_version)
Error in int: invalid base-10 literal: "22-ea"
ERROR: /home/yesudeep/code/foo/WORKSPACE.bazel:41:14: fetching coursier_fetch rule //external:maven: Traceback (most recent call last):
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/coursier.bzl", line 949, column 38, in _coursier_fetch_impl
                dep_tree = make_coursier_dep_tree(
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/coursier.bzl", line 853, column 30, in make_coursier_dep_tree
                if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
        File "/home/yesudeep/.cache/bazel/_bazel_yesudeep/e5f58afa44ddf02c410f9dc20a63651e/external/rules_jvm_external~/private/java_utilities.bzl", line 21, column 19, in parse_java_version
                return int(java_version)
Error in int: invalid base-10 literal: "22-ea"
ERROR: Error computing the main repository mapping: no such package '@@maven//': invalid base-10 literal: "22-ea"
Computing main repo mapping:
@yesudeep yesudeep changed the title Build failure on Linux system with JDK 22-ea installed. Build failure on Linux system with JDK 22-ea installed: Error in int: invalid base-10 literal: "22-ea" Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
yesudeep added a commit to yesudeep/rules_jvm_external that referenced this issue Mar 14, 2024
@yesudeep
Copy link
Contributor Author

yesudeep commented Mar 14, 2024

Temporary workaround for those affected:

  1. Install JDK 21: sudo dnf install java-21-openjdk

  2. Use env JAVA_HOME=/usr/lib/jvm/java-21-openjdk-21.0.2.0.13-1.fc39.x86_64 bazel build ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant