-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Cannot build :protobuf_java with Java 9 #4256
Comments
davido
added a commit
to davido/protobuf
that referenced
this issue
Jan 31, 2018
Fixes: protocolbuffers#4256. Bazel@HEAD supports Java 9. The current code has one single issue with Java 9 compliance: the usage of sun.misc package. We add jdk.unsupported module with --add-modules compiler option for now. Long term, the usage of non public API should be avoided. To build with Java 9, build custom bazel version and issue: $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk build \ --javacopt='--release 9' \ --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \ :protobuf_java
lucamilanesio
pushed a commit
to GerritCodeReview/gerrit
that referenced
this issue
Feb 8, 2018
We need to upgrade rules_closure tools to be able to build with Java 9. That's because rules_closure depends on dagger 2 and auto-common and auto-value, that need to be updated to not depend on legacy annotations (that are not available on Java 9). Moreover, latest rules_closure switched to building protobuf library from the sources, creating the next problem: Protobuf doesn't support Java 9 yet. That was fixed only on master, so that we need to update rules_closure to consume the protobuf dependency from HEAD. See these issues for more background: [1],[2],[3],[4]. [1] google/auto#560 [2] bazelbuild/rules_closure#234 [3] google/dagger#880 [4] protocolbuffers/protobuf#4256 Bug: Issue 7958 Change-Id: I56f3b6101e06bd678b4e42d3a9d52157963513aa
zhoutwo
pushed a commit
to zhoutwo/protobuf
that referenced
this issue
Apr 25, 2020
Fixes: protocolbuffers#4256. Bazel@HEAD supports Java 9. The current code has one single issue with Java 9 compliance: the usage of sun.misc package. We add jdk.unsupported module with --add-modules compiler option for now. Long term, the usage of non public API should be avoided. To build with Java 9, build custom bazel version and issue: $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk build \ --javacopt='--release 9' \ --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \ :protobuf_java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//CC @cushon @jart
Gerrit Code Review depends on
rules_closure
, that started to buildprotobuf_java
from source in their build tool chain very recently.This building of
:protobuf_java
from source broke Java 9 build support in gerrit ;-(To reproduce, install the most recent Bazel version: 0.10.rc8, or build Bazel from source, then run in protobuf@HEAD (b718551):
The text was updated successfully, but these errors were encountered: