gcc-c++.x86_64 0:4.8.5-36.el7
CentOS Linux release 7.6.1810 (Core)
~~~~~~~~~~~~
git clone https://github.com/google/j2cl.git
cd j2cl/samples/helloworld
bazel build src/main/java/com/google/j2cl/samples/helloworld:helloworld
~~~~~~~~~~~~~~
[root@nodejs helloworld]# bazel build src/main/java/com/google/j2cl/samples/helloworld:helloworld
INFO: Invocation ID: d6f32888-4450-42d4-ba4f-d876c36267ae
DEBUG: Rule 'com_google_j2cl' modified arguments {"sha256": "709ec52666421ca58f36067647fd8c5713bf375e9837bf2956e5bdd4d408989c"}
DEBUG: Rule 'io_bazel_rules_closure' modified arguments {"sha256": "45bff60125c4a9f54885100d27e9d94d443a85d7972ec61c98d09b5e3bc9e860"}
DEBUG: Rule 'org_gwtproject_gwt' modified arguments {"sha256": "823f139c9c21dd8279f0935516c54001555839e595f3c26b7184ac958cc4df1c"}
DEBUG: Rule 'com_google_protobuf' modified arguments {"sha256": "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2"}
INFO: Analysed target //src/main/java/com/google/j2cl/samples/helloworld:helloworld (2 packages loaded, 246 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/6079736e018d98f577dd81710783266d/external/bazel_tools/tools/jdk/BUILD:188:1: SkylarkAction external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1)
Exception in thread "main" java.lang.IllegalArgumentException: external/local_jdk
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.update(Unknown Source)
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.handleOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager$2.handleFileManagerOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.main.Option.process(Unknown Source)
at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(Unknown Source)
at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Unknown Source)
at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Unknown Source)
at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Unknown Source)
at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(Unknown Source)
at DumpPlatformClassPath.dumpJDK9AndNewerBootClassPath(DumpPlatformClassPath.java:106)
at DumpPlatformClassPath.main(DumpPlatformClassPath.java:67)
Target //src/main/java/com/google/j2cl/samples/helloworld:helloworld failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 169.421s, Critical Path: 12.56s
INFO: 183 processes: 183 local.
FAILED: Build did NOT complete successfully
[root@nodejs helloworld]#
Seems like an old bazel version:
Pls try:
$ npm install -g @bazel/[email protected]
I have already run
npm install -g @bazel/[email protected]
Can you try it in "CentOS Linux release 7".
Thank you!
Seems like this might happen if Bazel cannot find Java installation. https://github.com/bazelbuild/bazel/pull/7324 should improve things in the next bazel release.
Could you try
sudo apt-get install default-jdk
Closing this issue. Please provide my information if above instruction doesn't fix your issue.
If google sent you here because you've hit this issue, note that bazelbuild/bazel#7324 was not merged.
bazelbuild/bazel#6993 (https://github.com/bazelbuild/bazel/issues/6993#issuecomment-452954429) recommends either --javabase=@embedded_jdk//:jdk
or --javabase=@bazel_tools//tools/jdk:remote_jdk
I found bazel coverage --javabase=@bazel_tools//tools/jdk:remote_jdk11 //...
(s/remote_jdk/remote_jdk11/) works 2020-07-13.
Most helpful comment
Seems like this might happen if Bazel cannot find Java installation. https://github.com/bazelbuild/bazel/pull/7324 should improve things in the next bazel release.
Could you try
sudo apt-get install default-jdk