I got a new laptop with Windows 10 and I want to set it up so I can use java
and javac
from the command line.
I have searched online but all the guides are for previous versions, and I don't want to mess around with something I don't understand.
Just set the path variable to JDK bin in environment variables.
Variable Name : PATH
Variable Value : C:\Program Files\Java\jdk1.8.0_31\bin
But the best practice is to set JAVA_HOME and PATH as follow.
Variable Name : JAVA_HOME
Variable Value : C:\Program Files\Java\jdk1.8.0_31
Variable Name : PATH
Variable Value : %JAVA_HOME%\bin