Giter Club home page Giter Club logo

Comments (2)

cjohnstoniv avatar cjohnstoniv commented on June 4, 2024

minimum-project.zip

Attached is a minimum sample project to recreate the issue.

If you attempt to build the project you should get an error somewhere along the lines of:

ERROR: /home/cjohnstoniv/helm-farm/sample-java/BUILD:6:10: Building test-unit.jar (1 source file) failed: (Exit 1): java failed: error executing Javac command (from target //:test-unit) external/rules_java~7.1.0~toolchains~remotejdk21_linux/bin/java '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 19 arguments skipped)
src/test/java/hello/TestTest.java:10: error: ';' expected
        Fail me
               ^

The key piece of the error message is the: external/rules_java7.1.0toolchains~remotejdk21_linux/bin/java

I would expect this to be remotejdk11 based on the .bazelrc file.

from rules_java.

hvadehra avatar hvadehra commented on June 4, 2024

This has come up before in #148 and bazelbuild/bazel#19934

The behavior changed in bazelbuild/bazel@37eb1d7 during platformization of the java rules. From what I've gathered, the motivation for fixing the java_runtime version was to avoid issues in the default case, i.e. when a local jdk is in use. cc @comius to correct me / add more colour.

As explained in bazelbuild/bazel#19934 (comment) using a newer runtime shouldn't matter in practice, as we still correctly use the source/target language level. If you must use a specific runtime version, please declare a custom default_java_toolchain specifying the needed value for java_runtime.

from rules_java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.