What to do if Java command is not recognized by terminal.

Now a days we install java in our windows for our own work.But it’s quite annoying while it’s not recognized by the terminal.Sometimes we even run java file from terminal so it needs to be fixed.
So here is the thing that you can do.
Step 1:
First of all right click on this pc.
图片[1]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Step 2:
Go to properties and click advanced system settings.
图片[2]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Step 3:
Now click on environment variables.
图片[3]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Step 4:
Now look at user variables. Look if there is any path variable.
If there is path variable then look at Method 1..
If there is no path variable then look at Method 2..
图片[4]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Method 1:
in your case if there is path variable.You have to select path variable and click edit.
图片[5]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Now click on new . And paste the location of your java bin folder.
图片[6]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Click and copy the location.In my case it’s location is:
C:\Program Files\Java\jdk-14.0.1\bin

Now click on ok .Then open the terminal.
write–> “Java -version”.
图片[7]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
it should show your java version.
If it’s not then reinstall java by downloading java executable file from https://www.oracle.com/java/technologies/javase-downloads.html

Method 2
If there is no path variable then click on new.

write the variable name as “path” And paste the location of your java bin folder in variable value box.
图片[6]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
Click and copy the location.In my case it’s location is:
“C:\Program Files\Java\jdk-14.0.1\bin”

So i have wrote the variable name as “path” and pasted “C:\Program Files\Java\jdk-14.0.1\bin”

Now click on ok .Then open the terminal.
write–> “Java -version”.
图片[7]-What to do if Java command is not recognized by terminal. - 拾光赋-拾光赋
it should show your java version.
If it’s not then reinstall java by downloading java executable file from https://www.oracle.com/java/technologies/javase-downloads.html

Hope it will help you. Thanks !

原文链接:What to do if Java command is not recognized by terminal.

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容