1. Download and install the JDKDownload the JDK through the www.oracle.com
website ( Java develop kit) JAVA development kitInstall the downloaded jdk in a fool-proof way
Note: The installation path cannot contain Chinese characters
2. Configure environment variables
Right-click My Computer--> Properties --> Advanced system settings--> Environment variables
##Click New under System Variables--> Set the variable name: JAVA_HOME --> The variable value is the path where the JDK is installed --> Confirm
## in Find Path under System Variables and double-click --> Click New under win10 (enter directly at the front under win7) %JAVA_HOME%\bin --> Confirm
3. Verify whether the configuration is successful
Click on the keyboard win R --> Enter cmd --> Enter java -version
##This means that we have successfully matched it. Next, let’s complete the first program "Hello" World”
1) Create a new text under the path
2) Enter the main program of HelloWorld
class helloworld{ public static void main(String[] args){
System.out.println("hello world");
}
}
After saving, change the extension to .java
4) Enter a certain disk in cmd: Set the path to the disk --> cd The file we just entered Path
5) Use javac to compile the program into a class file
After compilation, a file with a .class extension will appear
6) Execute the first program hello world
Enter java helloworld
##Execution completed~
But we cannot execute code in this way every time we develop, so we must have a compiler
The compiler used in our development process is: eclipse
We will explain it first next time How to use eclipse
#END
Related articles:
JAVA entry system tutorial (2) Installing and using eclipse
JAVA entry system tutorial (3) Basic syntax (1)
The above is the detailed content of JAVA introductory system tutorial (1) Configuring JAVA development environment. For more information, please follow other related articles on the PHP Chinese website!