Like other languages, learning and using the Java language requires preparation in advance to download and install a compiler , that is, JDK . JDK is the abbreviation of English Java Development Kit, that is, Java development tools. It includes all environments that support Java compilation and running. Let’s start Go to the official download address: https://www.oracle.com/java/technologies/downloads/
Open the scroll to find the following location:
Everyone chooses the corresponding download based on whether their system is windows or linux.
PS: Because the official website may be updated, the link you open may be inconsistent with the pictures in this tutorial, which does not affect the configuration ideas.
Taking the Windows platform as an example, you can choose to download and install the second exe file. After the installation is completed, configure the most important environment variables. The configuration window is located: Right-click My Computer-Properties-Advanced System Settings, in the Advanced tab Click Environment Configuration.
Taking JDK1.8 version as an example, add the following three environment variables:
Variable name: JAVA_HOME
Variable value: C:Program Files (x86)Javajdk1.8.0_91 // Configure according to your actual path
Variable name: CLASSPATH
Variable value: .;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar; //Remember there is a .
Variable name: Path
Variable value: %JAVA_HOME%bin;%JAVA_HOME%jrebin;
After the configuration is completed, you can use the following method to verify whether the installation and configuration are successful. Open the command prompt (Start-Run-cmd) and enter javac and java vesion.
If the version information of java is displayed without " This command is not an internal or external command ", it will be successful!
Of course, if you want to enter the code stage more quickly, you can directly use dotcpp's online compilation tool to run the java code.