Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle command results in 'program not found' error on Windows #147

Open
heilhead opened this issue Oct 14, 2023 · 0 comments
Open

gradle command results in 'program not found' error on Windows #147

heilhead opened this issue Oct 14, 2023 · 0 comments

Comments

@heilhead
Copy link

On Windows, gradle fails to be invoked as a Command here (failing with the 'program not found' error):

let mut cmd = Command::new("gradle");

The gradle.bat is a batch file and needs to be executed via cmd:

    let mut cmd = if cfg!(target_os = "windows") {
        let mut cmd = Command::new("cmd");
        cmd.args(["/c", "gradle"]);
        cmd
    } else {
        Command::new("gradle")
    };

Also, the doctor command successfully resolves gradle to gradle.bat using which crate, but then Command fails to execute it. A bit misleading and needs to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant