remotely-built java_binary
s can't run locally
#10021
Labels
P2
We'll consider working on this in future. (Assignee optional)
stale
Issues or PRs that are stale (no activity for 30 days)
team-Rules-Java
Issues for Java rules
type: bug
Description of the problem / feature request:
java_binary
targets that are built with remote execution can't run locally, because the wrapper script has the wrong path to java.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create a straightforward
java_binary
with some deps, e.g.Build it with the a remote execution config using
rbe_autoconfig
from Bazel toolchains 0.29.8 and the default build container (e.g. with Google RBE).The binary builds fine with
bazel --config=remote build //:foo
. However, it fails when run withbazel --config=remote run //:foo
:The
java_binary
wrapper/launcher has the wrong java path:/usr/lib/jvm/java-8-openjdk-amd64/bin/java
is the path to java in the build container, but not locally.I can't find a combination of javabase/java_toolchain that makes the wrapper include my local JDK without breaking RBE. I can work around it with
--java_launcher=@bazel_tools//tools/jdk:java
but that results in a deprecation warning about local_jdk, so it's not a sustainable solution.What operating system are you running Bazel on?
centos 7
What's the output of
bazel info release
?release 0.29.1
Have you found anything relevant by searching the web?
I did ask on SO: https://stackoverflow.com/questions/58348645/remotely-built-java-binarys-cant-run-locally
I found this about the local_jdk deprecation warning but those solutions aren't compatible with
--java_launcher
: https://stackoverflow.com/questions/53066974/how-can-i-use-the-jar-tool-with-bazel-v0-19The text was updated successfully, but these errors were encountered: