Home >Java >javaTutorial >JAVA introductory system tutorial (1) Configuring JAVA development environment

JAVA introductory system tutorial (1) Configuring JAVA development environment

php是最好的语言
php是最好的语言Original
2018-08-10 10:02:411935browse

Configuring the JAVA development environment

1. Download and install the JDKDownload the JDK through the www.oracle.com

website ( Java develop kit) JAVA development kit

JAVA introductory system tutorial (1) Configuring JAVA development environment

Install 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

JAVA introductory system tutorial (1) Configuring JAVA development environment

##Click New under System Variables--> Set the variable name: JAVA_HOME --> The variable value is the path where the JDK is installed --> Confirm

JAVA introductory system tutorial (1) Configuring JAVA development environment

## in Find Path under System Variables and double-click --> Click New under win10 (enter directly at the front under win7) %JAVA_HOME%\bin --> Confirm

JAVA introductory system tutorial (1) Configuring JAVA development environment

3. Verify whether the configuration is successful

Click on the keyboard win R --> Enter cmd --> Enter java -version

JAVA introductory system tutorial (1) Configuring JAVA development environment

##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

JAVA introductory system tutorial (1) Configuring JAVA development environment

5) Use javac to compile the program into a class file

JAVA introductory system tutorial (1) Configuring JAVA development environment

After compilation, a file with a .class extension will appear

6) Execute the first program hello world

Enter java helloworld

JAVA introductory system tutorial (1) Configuring JAVA development environment

##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


With this software we can start our java development journey

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn