Java download, install and configure environment variables

1. Download JDK

  • Oracle officially has download conditions, but it is still slow, so use the mirror station to download JDK
  • The programming treasure house is currently the most complete Java JDK mirror station in China.
  • JDK Download- Programming Treasure

2. Configure environment variables

  1. Right-click "Computer-Properties-Advanced System Settings", click "Environment Variables".
  2. Create a new one under "System Variables", variable name: JAVA_HOME; variable value: jdk installation path.
  3. Create a new variable name "CLASSPATH" in "System Variables", variable value ".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar"
  4. Find the path editor under "System Variables", create a new "%JAVA_HOME%\bin"; then create a new "%JAVA_HOME%\jre\bin", click OK.

 3. Test JDK

  • Enter cmd and enter java, javac or java -version to check whether Java is installed correctly

Guess you like

Origin blog.csdn.net/weixin_44523517/article/details/131896374