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
-
Create a folder at will, store the code
-
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
-
Write code
public class Hello//public class 类+名字 { public static void main(String[] args){ //修饰符关键字,main方法,String[] 参数。 System.out.print("Hello,World!"); } }
-
Compile javac java file, will produce a class file
-
Run class file, java class file
Possible problems
- The size of each word cannot be a problem, Java is case sensitive
- Try to use English;
- The file name and class name must be consistent, and the first letter must be capitalized
- Chinese symbols are used