0

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

4
  • 1
    Ultimately it has to appear in PATH: %JAVA_HOME%\bin; needs to be there. The environment variable JAVA_HOME on its own is not enough. Commented Jul 17, 2018 at 13:26
  • Try restarting the command prompt/machine. Then check if the variable is set up. Commented 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? Commented 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 answers Commented Jul 19, 2018 at 14:06

1 Answer 1

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%
Sign up to request clarification or add additional context in comments.

2 Comments

No, that will override the previous path entries, I suggest this one : set path=%PATH%;C:\Program Files\Java\jdk1.8.0_102\bin
Yes. Updated the post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.