Facing Gradle issue on WSL

Hi All,

I’m running my local development environment on WSL (Ubuntu 24.04), and I’m facing a recurring issue when trying to build a Java project or debug unit test cases using Gradle.

The build consistently fails with the following error:

FAILURE: Build failed with an exception.

Where:
Script '\\wsl.localhost\Ubuntu-24.04\home\k750\Develop\github.sap\master\build-system\gradle\scripts\buildsystem_build.gradle' line: 2

What went wrong:
A problem occurred evaluating script.
> Failed to apply plugin class 'com.sf.buildsystem.buildsystem.BuildSystemPlugin'.
> Cannot run program "git" (in directory "\\wsl.localhost\Ubuntu-24.04\home\k750\Develop\github.sap\master\build-system"): error=2, No such file or directory

I don’t believe this is an issue with Git itself or GitHub. Git is installed and accessible within the WSL environment, and works fine otherwise.

Has anyone encountered this before or can suggest a permanent fix? Any leads or ideas would be much appreciated.

Thanks in advance!

Given that the path in the error is starting with \\wsl.localhost\Ubuntu-24.04\, you are not executing this in WSL context, but in Windows context just using the files in the WSL filesystem.

Besides that this extremely slows down the build (assuming you use WSLv2), it means git would need to be accessible on Windows, not WSL.