Crazy God said java study notes --- JAVA development environment to build

JAVASE

JAVA development environment construction

  • JDK download and installation
  • Configure environment variables
  • JDK catalog introduction
  • HelloWorld and simple grammar rules
  • Notepad++ installation and use

JAVA download and installation

Uninstall JDK

1. Delete the Java installation directory

2. Delete JAVA_HUME

3. Delete the directory about Java under the environment variable path

4.Java - version

Install JDK

1. Baidu search JDK8, find the download address

2. Agree to the agreement

3. Download the version corresponding to the computer

4. Double-click to install JDK

5. Remember to install to the path

6. Configure environment variables

​ 1. My Computer -> Advanced System Settings -> Environment Variables

​ 2.Environmental variables-->JAVA_HOME

​ 3. Configure path variables, java\jdk\bin and java\jdk\jre

7. Test whether the JDK is installed successfully

​ 1. Open cmd

​ 2.java -version

java file

bin directory

Put some executable files, such as java, javac (compiler)

include directory

Put some C voice header files

jre directory

Operating environment

lib directory

Some library files of java

src.zip

Resource files, various java classes and basic source code

HelloWorld

  1. Create a folder at will, store the code

  2. Create a new java file

    • The file extension is .java
    • Hello.java
    • [Note] The system may not display the file extension, we need to open it manually
  3. Write code

    public class Hello//public class 类+名字
    {
          
          
    	public static void main(String[] args){
          
          //修饰符关键字,main方法,String[] 参数。
    	System.out.print("Hello,World!");
    		}
    }
    
  4. Compile javac java file, will produce a class file

  5. Run class file, java class file
    Insert picture description here

    Possible problems

    1. The size of each word cannot be a problem, Java is case sensitive
    2. Try to use English;
    3. The file name and class name must be consistent, and the first letter must be capitalized
    4. Chinese symbols are used

Guess you like

Origin blog.csdn.net/rzz65452064/article/details/107178118