Comments (2)
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.
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)
- Upgrade from 5.4.0 to 5.5 errors HOT 3
- Dependency on `rules_license` HOT 1
- Problem in version 6.5.0: no such target '@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type' HOT 7
- Flip `incompatible_disallow_empty_glob`
- Add jmods to jdk targets HOT 1
- Add support for JDK 21 HOT 1
- Push a new release containing JDK 21 HOT 14
- Java toolchain is not respected HOT 2
- Release: rules_java 7.3.1 HOT 1
- JRE logs to stdout and breaks javac/scalac worker on certain environments HOT 2
- rules_java > 7.2.0 incorrectly states it is compatible with Bazel >= 6.4.0 HOT 1
- Provide a way of packaging separate layers into Java container after deprecation of rules_docker HOT 3
- CI postsubmit is broken HOT 3
- Release: rules_java 7.3.2 HOT 4
- Turbine native image broke NONPREBUILT_TOOLCHAIN_CONFIGURATION
- Release: rules_java 7.4.0 on BCR HOT 3
- Broken local Java version detection
- Improve performance when running a large number of JUnit tests HOT 1
- java_tools should have prebuilt Linux AArch64 binaries HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_java.