Download latest bazel-wsl.exe
to any location and change Bazel binary location in
(screenshots took from macos just for convenience):
Install preferred bazel version in wsl linux distro (I'd strongly recommend to use Bazelisk)
Download your bazel project to any location inside in default WSL distro and open it with IntelliJ IDEA WSL integration
Press "Sync project with BUILD files" button and wait for initial synchronization (It may take some time to initial bazel cache population)
As for bazelbuild/intellij#3112 manually patched version of bazel intellij plugin should be created (in order to fix dependencies resolution problem on wsl environments)
- On most Windows machines the default wsl distro is set to docker machine. As for now project must be on default wsl distro (you could check all distros with
wsl --list --all
, default will be labeled as Default) and change it withwsl --setdefault <DistributionName>
, likewsl --setdefault Ubuntu-20.04