Zhang Xiaoxiang Java First Lecture

Source: Internet
Author: User

One, the characteristics of Java: A compile, run time everywhere.

C language executes under Windows: C source program (. c)--Compile the Windows executable (. exe)-->windows operating system

Java language: Java source file--compile Java bytecode file (. Class)-->JVM virtual machine (can directly interpret Java bytecode CPU)--"execute the corresponding bytecode program under different operating systems

| |

Under Linux under Windows

Bytecode Program byte Code program

Second, the connotation of Java

1, is a programming language (Java source file)

2, is a development tool (compiled into bytecode files)

3, is a running environment (JVM virtual machine)

III. Building the development environment

1. JDK: Development tools: Javac (Compile) and basic core class development environment: Java (interpretation execution) and basic core class

2, Java EE (Enterprise Development) J2SE (Standard development) J2ME (mobile application development)

Iv. setting of environment variables

1. Set command: View all environment variables (My Computer-system Properties-environment variables (including user variables and system variables) if user variable name = System Variable name = User variable value + system variable value)

2. Set environment variable name: View an environment variable value

3, set XX=A setting environment variable set xx= NULL Cancel environment variable (valid only for the current command line window)

4. Add content A to the environment variable path, copy the existing value of path, + new value B, set%path%;+ new value%path%--The value of the original path (note = cannot use spaces around)

5, in the system variable settings, will not affect the command line window has been opened, and the user variable settings, the need to restart the computer to start the role.

6, when executing the Java command, first find the current--path variable

7. When the system is loaded with multiple JDK: Java-verbose file loading process detailed print in command line window

V. Experience the process of Java programming

1  Public classTest//there can be only one public class in a Java source file and the class name is the same as the source file name2 {3        Public Static voidMain (string[] args)//class can have the main function to execute the program, each class can have a main function4       {5System. out. println ("Hello world!");6        }            7 }8 9 classTest1Ten { One       Public Static voidMain (string[] args) A       { -System. out. Print ("Hello world2!"); -        } the } -     

1, Javac Test.java compiled Test.class and test1.class bytecode files, a Java source file can have more than one class, each class can compile the corresponding bytecode file.

2, compile, such as error: Cannot find xx file, please check the source file name extension is correct (insert file into Run window or command Line window Inspector file extension)

3, set classpath= "+; Do not add semicolons do not check the current directory with a semicolon to check the current directory classpath Specifies the Java Virtual machine Lookup directory path refers to the Java compilation directory

4, the current directory contains to Classpath:set classpath=xx;.

5, do not put the source files in the directory name itself has a blank folder

Vi. Operating Procedures for JVM virtual machines

1, the amount of code loading

2, the code of the check

3, the execution of the Code

Zhang Xiaoxiang Java First Lecture

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.