From the zero-learning Java (1)-Environment building, write HelloWorld with Notepad

Source: Internet
Author: User
Tags save file

    • Common DOS commands:

E: Enter the e-packing directory
CD: Go to a directory
Cd.. : Return to Parent directory
Cd\: Return to the root directory
MD: Creating a Directory
RD: Deleting a directory
Del: Delete Files
CLS: Emptying windows
Exit: Exit DOS command line

    • Java architecture: Javase, Java EE, javame
    • Java language Features:

Fully Object-oriented language
Cross-platform (provides an interpreted environment JVM that runs under different platforms)
A robust language (absorbs the advantages of C, C + +)
High security (automatic garbage collection, mandatory type checking, and cancellation of pointers)

    • The core mechanism of Java technology:

Java Virtual Machine (JVM): Different JVM for different platforms
Garbage collection Machine (GC): Automatically enabled during program operation, no programmer can control and intervene accurately

    • JDK and JRE:

JDK (Java Development Kits)--Java Developer toolset

JRE (Java Runtime Environment) Java Runtime Environment

Jvm
Java API (Application programming Interface)
java compiler (Javac.exe), Java Runtime Interpreter (Java.exe), Java documentation Tools (Javadoc.exe), and other tools and resources
The three main features of the JRE are:
Load code: Completed by class loader (loader);
Checksum code: By the Byte Code Checker (bytecode verifier) completed;
Execution code: completed by Runtime interpreter (runtime interpreter).

    • Building a Java Development environment:
      1. Download: Oracle website download
      2. To configure environment variables:
      3. Path adds the paths to the bin directory in the JDK installation directory in the path variable to end. (PS: Try to copy and paste, do not write manually, it is easy to error)
      4. Classpath creates a new CLASSPATH environment variable, which is generally only entered in its value.; , which is an English point and a semicolon under the English language.
      5. Verify that the environment variable is configured successfully
      6. Open a command-line window, enter Javac, and then enter
      7. Then enter Java, then go to
    • First Java program: HelloWorld

Open Notepad and enter the following:

 Public class HelloWorld
{ publicstaticvoid main (string[] args)
{ System.out.println ("Hello,world"); System.out.println ("Hello,java"); } }

Save file name is Helloworld.java
Open DOS command line: Run->cmd (or press win+r)
Use DOS command to enter HelloWorld's Save directory
Compiling: Input Javac Helloworld.java
Run: Enter Java HelloWorld

You can see the screen output: Hello,world
Hello,java

Note: When the class is decorated with public, the file name must be consistent with the class name;
The statement ends with an English half-width semicolon;
The case of the keyword.

From the zero-learning Java (1)-Environment building, write HelloWorld with Notepad

Related Article

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.