Xtra Slo
Xtra Slo

Reputation: 11

VSCode 'java' is not recognized as an internal or external command, operable program or batch file

As the title says, I get the following error when I try to run Java commands in the VSCode terminal:

'java' is not recognized as an internal or external command, operable program or batch file.

However, I am able to run these commands in my normal windows CMD, so I don't understand why it doesn't work in VSCode.

I have added the java bin path to the PATH environment variable.

Thanks in advance! :)

Upvotes: 1

Views: 8085

Answers (1)

Mehdi Ahangar Kiasari
Mehdi Ahangar Kiasari

Reputation: 56

I had the same problem. I share my experience it may work for you.

1- Firstly, you can install java package extension for VS Code, you can search it easily, find it in the extension in VS Code, and choose one of them to install.

2- Another tricky thing happened for me is that, if you use terminals in VS Code, after changing environmental variables or installing new extension, it's better to restart the computer, then open the VS Code, kill the current terminal tab and open a new one and try the java -version command again.

Regards

Upvotes: 2

Related Questions