-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Support for JDK 11 #6245
Comments
@cushon Do you have a road map / timeline for support for JDK 11? |
@cushon please add a priority label, thanks! |
cc @iirina |
#6592 seems to be related. |
FYI, I have to disable some tests for ubuntu1804_java11
https://buildkite.com/bazel/google-bazel-presubmit/builds/14214#d7b484bc-ed66-4bf0-aa53-6b148c255e03 |
@cushon should |
This can be closed altogether. |
you mean everything is supported? are there docs for bazel and jdk11? |
for example what is the toolchain I should use for jdk11 |
https://github.com/bazelbuild/bazel/blob/108bc5aaf46c4ec5e6dc0ac7c81c2f16d9ae2a21/tools/jdk/BUILD shows |
I don't think you're supposed to use the toolchains named in that style anyway if you want the new stuff, the one that's just called But I haven't checked whether the language level for Java 11 is usable yet, and buildjar still seems to depend on langtools' javac which is |
Can someone clarify how the point 3 from the issue description is solved on Bazel@HEAD? |
The Java 11 language level works for me at head:
|
Thanks, is this the recommended way of setting the language level, or will the toolchain rule be updated to have a Also assuming this works with remote_jdk11 as the host_javabase and not just when setting JAVA_HOME? |
@cushon, can you clarify how to use this feature? Bazel at head defines toolchain_java8 and toolchain_java9, but not toolchain_java10 or toolchain_java11. I was able to roll my own like this: default_java_toolchain(
name = "toolchain_java11",
source_version = "11",
target_version = "11",
visibility = [
"//visibility:public",
],
) then activate it by default from my bazelrc:
But now building a simple java_library fails with the following:
I believe this means the JVM used in the host configuration doesn't understand source release 11. OK, let's set this explicitly in bazelrc:
But this doesn't make a difference; I get the same stack trace as above. Is there a piece of the puzzle I'm missing? |
With bazel@HEAD I tried reproducing with your example but I could run a Java 11 binary. Make sure that you are using bazel built@HEAD otherwise the We are planning to soon make available the toolchains for java version 9-12 under https://github.com/bazelbuild/java_tools. |
1d82cf8 introduced |
As of today (2018-9-25), JDK 11 is generally available: http://jdk.java.net/11/.
Bazel should support it, including:
--host_javabase
) [incompatible_use_jdk11_as_host_javabase: makes JDK 11 the default --host_javabase for remote jdk #7219]--javabase
) [done]--java_toolchain
/--host_java_toolchain
)The text was updated successfully, but these errors were encountered: