Just set the path variable to JDK bin in environment variables.
Variable Name : PATH
Variable Value : C:Program FilesJavajdk1.8.0_31in
But the best practice is to set JAVA_HOME and PATH as follow.
Variable Name : JAVA_HOME
Variable Value : C:Program FilesJavajdk1.8.0_31
Variable Name : PATH
Variable Value : %JAVA_HOME%in
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…