1.java development of the most basic tool JDK (is a software that needs to be installed)
Download the JDK installation package on the Web, note that a JRE installation will also pop up during the JDK installation, which cannot be installed under the same directory, or the main class cannot be found or cannot be loaded when code is compiled with a command-line window Com.sun.tools.javac.Main
2 Beginners can use the notepad++ compiler, not recommended with eclipse
I built a file in F, SRC, built a txt text under SRC, and renamed Hello.java (Note: 1. The first letter here is capitalized, and Java's requirements for the first letter are strict. 2. Here is the file suffix Java), open the file with notepad++. Start Writing the code as follows:
public class Hello ( //Note public class is a fixed hello first letter to capitalize, same as file name Hello.java )
public static void Main (String arge []) {
System.out.println ("Hello world!");
}
)
Press Ctrl+s to save the file. If it appears, the description file has been modified but not saved
compile the file: Press Windows+r to open the Command Line window, enter cmd and press RETURN
In, from top to bottom:
C:\users\bxf> refers to the current command line location, because I set up a src file in the H-disk, in SRC build Hello.java
So enter H: (note here there is a colon OH), press ENTER, input CD src (here the CD means to enter the file, CD src means to enter the src file), if you want to see the SRC content, you can enter Dir, as shown in, input Javac Hello.java (Note that there is a space behind the javac), if nothing is shown, but at the same time a Hello.class file appears below the Hello.java file stating that the compilation succeeded
Enter Java hello in the command line window (note that there is no. java), press ENTER directly, and see Hello world! Be printed out, like, the first Java program succeeded!!
Java Learning Note One