简体   繁体   中英

Command 'gradle -v' not found in VS Code terminal/PowerShell but in standalone terminal/PowerShell

When I run: PS C:\Users\myname\Desktop> gradle -v in my VSCode Terminal I get the exception gradle: The term 'gradle' is not recognized as the name of a cmdlet...

When I run the command in PowerShell everything works like expected. Therefore I assume that my path in the environment variable settings is correct.

Why VSCode Terminal don't know the command gradle -v ?

EDIT: The terminal outside of VS Code also works like expected!

I observed very same error in both VSCode Terminal and InteliJ Idea Terminal, at all gradlew commands (like build, clean...) each gradlew command works as expected when I use CMD but not in any IDE, I use /gradle-7.3.3, jdk 11.0.13

Try on the bash terminal it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM