Question
I'm using Visual Studio Code's terminal (on a Windows 11 device) and can't run commands like java, flutter etc., be it VS Code's Powershell terminal or VS Code's Command Prompt terminal.
When I try to run java by typing java in the VS Code Powershell terminal, it displays:
PS C:\users\user> java
java : The term 'java' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ java
+ ~~~~
+ CategoryInfo : ObjectNotFound: (java:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
When I try to run java by typing java in the VS Code Command Prompt terminal, it displays:
C:\users\user> java
'java' is not recognized as an internal or external command,
operable program or batch file.
I can run java and flutter fine from the regular Windows Command Prompt (their bin folders are in the Path environment variables).
How do I allow these commands to be run in the VS Code terminal?
I've tried uninstalling and reinstalling VS Code, thinking I would be able to then run the commands, but I get the same problem.
I'm already able to run a java program using the "Run java" button in the top-right of the window. However, I want to be able to run java by entering the command in the VS Code terminal, similarly to running commands in Command Prompt.
I already have the "Extension Pack for Java extension" and "Dart" extensions for VS Code.
Solution
Thanks to @Steven-MSFT!
My User/settings.json contained:
"terminal.integrated.env.windows": {
"PATH": "C:\\ghcup\\ghc\\8.10.7\\bin"
},
I deleted "PATH": "C:\\ghcup\\ghc\\8.10.7\\bin"
from User/settings.json.
"terminal.integrated.env.windows": {
},
Now I can run commands like java, flutter (etc.) from the VS Code terminal.

