I have tried as many answers available here to set java path. I have placed the JAVA HOME,JDK HOME and JRE HOME PATHS in the system environment variables but java still cannot be found using the command prompt "where" nor can it be executed using "java". pls help
Asked
Active
Viewed 907 times
0
-
1Ultimately it has to appear in PATH: %JAVA_HOME%\bin; needs to be there. The environment variable JAVA_HOME on its own is not enough. – duffymo Jul 17 '18 at 13:26
-
Try restarting the command prompt/machine. Then check if the variable is set up. – Rafael Palomino Jul 17 '18 at 13:28
-
Duplicate of [What is the reason for '...' is not recognized as an internal or external command, operable program or batch file?](https://stackoverflow.com/questions/41454769/what-is-the-reason-for-is-not-recognized-as-an-internal-or-external-comman) – Mofi Jul 18 '18 at 06:22
-
the variable is set up right. i have also tried restarting the cmd window and running it in admin mode it still doesnt work. but i'll try the %JAVA_HOME%\bin format and see if that works. thanks for the answers – megamind5000 Jul 19 '18 at 14:06
1 Answers
1
Try running the following in the command promt.
set path=%path%;C:\Program Files\Java\jdk1.8.0_102\bin
Change the path based on the java version you are using. If its still not working then try the following: Try running it in cmd (administrator mode). Try restarting the cmd.
You should be able see the java path in here.
echo %path%

Sahal
- 278
- 2
- 10
-
1No, that will override the previous path entries, I suggest this one : `set path=%PATH%;C:\Program Files\Java\jdk1.8.0_102\bin` – Mustapha Belmokhtar Jul 17 '18 at 13:33
-
1