I am trying to set java path on my windows 8.1, and i installed jdk 8u 64 bit and in environmental variables under system variables there is no PATH found,so i incuded new path variable to set path for jdk and jre ,by copying the bin path of jdk C:\Program Files (x86)\Java\jdk1.8.0_40\bin and i appended jre path C:\Program Files (x86)\Java\jre1.8.0_40,but it doesnt work when i tried in command prompt by typing "java -version"

and "javac" it says that java is not a internal or external command. and i had a doubt that to run java through command prompt ,do we need any other installations like turbo c

thank you

javac is not part of jre, but part of jdk. So have C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Java\jre1.8.0_40\bin in the path. As Anand noted, the ; is missing as well.

This path is wrong -

C:\Program Files (x86)\Java\jdk1.8.0_40C:\Program F iles (x86)\Java\jre1.8.0_40\bin

you need a ; in between the two different paths.

C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program F iles (x86)\Java\jre1.8.0_40\bin

If you are trying to add the path in the user variables

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66

in the JAVA_HOME don't add any semicolan (;) and

path=C:\Program Files\Java\jdk1.8.0_66\bin;.;

in the path section end of the line add ;.; to consider all paths and save. Then try to restart system and open the command prompt and try to check

1. java -version
2. javac

JAVA_HOME AND PATH

Top