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.
Step 2:
Go to properties and click advanced system settings.
Step 3:
Now click on environment variables.
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..
Method 1:
in your case if there is path variable.You have to select path variable and click edit.
Now click on new . And paste the location of your java bin folder.
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".
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.
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".
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 !
Top comments (0)