Java language Platform:
* JSE
Developing common desktop and business applications, the technology system is the basis for the other two,
* JME
developing electronic consumer products and embedded devices
* JEE
developing applications in an enterprise environment .
Java language Features
* Object oriented;
Open source
* Cross-platform: Java's cross-platform is not a true cross-platform, but Java itself uses a semi-interpreted, semi-compiled approach, and defines the concept of a Java Virtual machine (JVM). The Java source Code first generates the bytecode through the Java compiler (JAVAC) and then loads the bytecode into the JVM execution. Embedding the corresponding JVM,JVM in different operating systems will mask the differences between the underlying hardware and the operating system, thus enabling a cross-platform of the Java language .
Development environment Preparation:
Installation of JDK:
Official website http://www.oracle.com; Double-click the Setup program.
Precautions:
* Installation path do not have Chinese or special symbols such as spaces;
* All development related software is best installed directory unified.
Verify that the installation is successful
* Switch to the bin directory of the JDK installation via DOS command, then enter Javac and Java separately, if some content is displayed correctly, the installation is successful.
Configuring Environment variables
1. Right click on desktop computer → select Properties → advanced system settings → advanced tab → click environment variables → find path→ under System variables double-click path→ to add the bin directory under the JDK installation directory to the leftmost and add a semicolon .
2. Configure the Java_home first, and then modify the path
HelloWorld Writing and running
Note: (Explain the program; Help us debug errors);
// class name : A Java file can have only one public class, and this common class must have the same class name as the file name
public class HelloWorld {
//Any Java program must have one, and only one main method, a Java program always start from the main program, regardless of its location throughout the program Public static void Main (string[] args) {
Output statement
System.out.println ("HelloWorld");
}
}
execute on DOS command line: A, open DOS command in the directory where Java files are located;
b, Javac Helloword.java;
C, Java Helloword.
problems encountered:
* File not Found
A, File extension shadowing causes compilation to fail
b, the file name is wrong
* word spelling problem
A, class written as Class
b, string written as String
C, main written Mian
* bracket matching problem
A. Remove the curly braces from the class body
B. Remove the curly brace of the method body
C, cut out the curly brace for the output statement.
* Chinese and English issues
Hint message: Error: illegal character: \???? The format
Java Learning Lesson 01