Java Learning Note One

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.