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
-
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– duffymo2018-07-17 13:26:16 +00:00Commented Jul 17, 2018 at 13:26
-
Try restarting the command prompt/machine. Then check if the variable is set up.Rafael Palomino– Rafael Palomino2018-07-17 13:28:27 +00:00Commented Jul 17, 2018 at 13:28
-
Duplicate of What is the reason for '...' is not recognized as an internal or external command, operable program or batch file?Mofi– Mofi2018-07-18 06:22:51 +00:00Commented Jul 18, 2018 at 6: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 answersmegamind5000– megamind50002018-07-19 14:06:51 +00:00Commented Jul 19, 2018 at 14:06
Add a comment
|
1 Answer
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%
2 Comments
Mustapha Belmokhtar
No, that will override the previous path entries, I suggest this one :
set path=%PATH%;C:\Program Files\Java\jdk1.8.0_102\binSahal
Yes. Updated the post.