I have a java_binary
target in my workspace that I'm later passing as an executable to ctx.actions.run
inside the rule. So far so good.
Now I want to debug this java_binary
while Bazel is executing the rule. In order to attach a debugger I need the java_binary
run in debug mode. So far, the only thing I came up with is setting jvm_flags
on the java_binary
. I was able to get that to work. But I was wondering if there is a way to achieve it from the command line instead of baking it into the java_binary
.
java_binary(
...
jvm_flags = [
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
],
)
Is it possible to achieve this from the command line without hard coding jvm_flags
?