1. Download and install JDK8 compact version.
2. During the installation process, select Custom Installation and uncheck Install JDK Toolkit and JRE.
3. After the installation is completed, manually copy all files in the JDK bin directory to a new folder, such as jre.
4. Add the JAVA_HOME variable to the system environment variable, and the value is the new JRE folder path.
5. Add a path variable with the value of %JAVA_HOME%\bin; % PATH % 1 .
6. Add a classpath variable with the value of% JAVA _ HOME% \ lib; % JAVA _ HOME % \ libtools.jar。