IntelliJ Fast Run / Debug does not automatically pick the correct path to java
in the runfiles directory
#6554
Labels
lang: java
Java rules integration
P3
We're not considering working on this, but happy to review a PR. (No assignee)
product: IntelliJ
IntelliJ plugin
type: bug
Description of the bug:
I am trying to use the
Fast Run
feature of the intellij plugin for bazel. In our setup, we are using the default Java toolchains with a remote JDK toolchain, which is used for hermetic testing and compilation: https://bazel.build/docs/bazel-and-java#hermetic-testingWhen trying to run a fast build, I get the following error
In our setup, the java binary is present at
../remotejdk11_linux/bin/java
.Looking at the code, it seems the fast build set up is hardcoded to look for the
local_jdk
, rather than the jdk configured in our toolchainintellij/java/src/com/google/idea/blaze/java/run/fastbuild/BazelFastBuildTestEnvironmentCreator.java
Line 29 in eaa6b20
I would expect the plugin to identify what is the toolchain setup, and pick the appropriate path to the java binary.
Which category does this issue belong to?
Intellij
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create a fresh bazel WORKSPACE with a simple java test target and add the following to your
.bazelrc
:Open the project in IntelliJ and start a Bazel sync. Try to Fast Run your test class. It should fail with the above error message
Which Intellij IDE are you using? Please provide the specific version.
IntelliJ IDEA 2024.1 Build #JBC-241.14494.240
What programming languages and tools are you using? Please provide specific versions.
Java 11, Bazel 7.2.1
What Bazel plugin version are you using?
2024.06.18.0.1-api-version-241
Have you found anything relevant by searching the web?
I found #6431 which introduces an option to manually specific the path to the java binary in the runfiles directory. As a work around, I can set this to
remotejdk11_linux/bin/java
manually.However, this is quite fragile, as now if we ever make changes to our toolchain setup then end users' fast runs will break
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: