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

toolchain_hostjdk8 breaks in bazel 0.21: passing -Xbootclasspath/p to java9 #7158

Closed
asuffield opened this issue Jan 17, 2019 · 5 comments
Closed
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Java Issues for Java rules type: bug

Comments

@asuffield
Copy link
Contributor

Description of the problem / feature request:

--java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 no longer works in bazel 0.21. The javac workers fail to start with:

---8<---8<--- Start of log ---8<---8<---
-Xbootclasspath/p is no longer a supported option.
ion.
---8<---8<--- End of log ---8<---8<---

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

git clone https://github.com/bazelbuild/examples/
cd examples
bazel build //:ProjectRunner --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8

What's the output of bazel info release?

release 0.21.0

What I've figured out so far: this combination tries to run the remotejdk (zulu java 9) with JDK8_JVM_OPTS, which are not accepted by the new jvm.

@jin jin added team-Rules-Java Issues for Java rules untriaged labels Jan 17, 2019
@cushon
Copy link
Contributor

cushon commented Feb 26, 2019

Are you setting a --host_javabase? --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 only works if you explicitly configure a JDK 8 host javabase.

Does your build work if you remove the --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 flag and use the default toolchain?

@asuffield
Copy link
Contributor Author

Ah, that would explain why it fails. Yes, the default toolchain is fine.

So we can call this one an incomprehensible error message for an invalid combination of options, and see if there's some way to report the actual problem.

@lberki lberki added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Mar 13, 2019
@lberki
Copy link
Contributor

lberki commented Mar 13, 2019

Yeah, that's a pretty accurate description. Marking this P3 because this is "just" an error message issue.

@perezd
Copy link
Contributor

perezd commented May 26, 2019

So I'm seeing this as well if I do the following in my bazelrc:

common --define=ABSOLUTE_JAVABASE=/usr/lib/jvm/java-11-openjdk-amd64 \
       --javabase=@bazel_tools//tools/jdk:absolute_javabase \
       --host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
       --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
       --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla

Following along here: #5723
I am trying to run my existing bazel project using host jdk11 (ubuntu)

Bazel version 0.25.3 here

@comius comius added the area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository label Nov 21, 2020
@sgowroji sgowroji added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 16, 2023
@sgowroji
Copy link
Member

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

@sgowroji sgowroji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-java-toolchains javabase, java_toolchain flags, JDK selection, java_toolchain rules, java_tools repository P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Java Issues for Java rules type: bug
Projects
None yet
Development

No branches or pull requests

7 participants