Regarding the instructions in "How can I create my first
Java program?" for configuring a new System variable JAVA_HOME and then adding "%JAVA_HOME%\bin;" to the beginning of System Path, everything works great on my work laptop running Windows 7.
No issues, works as expected. Life is good.
However, not so on my personal laptop running Windows 8.1. I don't know if this is a Windows 8.1 issue, my particular configuration of my Windows 8.1, there is some other trick that I don't know, or user error. Darn users.
;-)
My symptoms are as follows:
Same process on Windows 8.1 that I did on Windows 7.
Configure a new System variable JAVA_HOME set to "C:\Program Files\Java\jdk1.8.0_11" and then add "%JAVA_HOME%\bin;" to the beginning of System Path as directed.
Open a new CLI and type "javac -version" and the correct version appears as expected.
Everything works fine until I reboot.
After rebooting "javac -version" returns the dreaded "'javac' is not recognized as an internal or external command . . . ".
"path" at the command line returns the current path, however, in the path displayed I do not see the character
string
"C:\Program Files\Java\jdk1.8.0_11\bin", instead is see "%JAVA_HOME%\bin;".
If I open Environmental Variables and confirm that the variable named JAVA_HOME and Path are correct by viewing but not changing anything, not even clicking on <Edit>, then <OK> to exit, next time I open a new CLI "javac -version" works correctly and my "path" command correctly displays the actual path "C:\Program Files\Java\jdk1.8.0_11\bin;" at the beginning of my path as expected instead of "%JAVA_HOME%\bin;" .
This is reproducible every time.
My resolution was to delete the System variable JAVA_HOME and use "C:\Program Files\Java\jdk1.8.0_11\bin;" in the Path instead of "%JAVA_HOME%\bin;".
Am I doing something wrong?
Does this work correctly for others on Windows 8.1?
I'm OK with user error, but I cannot figure out what I need to do different in order to use the variable with the Path.
Thank you in advance for your time and experience.
Cheers,
Tim