Java Introduction and configuration and construction of platform and development environment
1. Introduction to Java
Java is an object-oriented programming language with many features such as cross-platform, portable, distributed, simple, extensible, and so on. Java can be used for desktop applications, Web applications, distributed systems and applications such as embedded development.
Java contains 3 different versions, J2ME/J2EE/J2SE (mini/Enterprise/Standard).
2, the JDK download and installation, configuration
(1), jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
(2), configure the JDK: you need to configure two environment variables: path and classpath (case insensitive). As shown in the following:
Input: path and C:\Program files\java\jdk1.8.0_45\bin;
Input:CLASSPATH and C:\Program Files\java\jdk1.8.0_45\lib\dt.jar; C:\Program Files\java\jdk1.8.0_45\lib\tools.jar;
Finally, verify that the JDK is configured successfully by entering CMD in a DOS environment, then entering Java-version, enter, and output as the content proves the configuration was successful.
3. Download and installation of Eclipse
Eclipse: http://www.eclipse.org/downloads/(directly unzip, run the application. )
Or
MyEclipse: http://downloads.myeclipseide.com/(myeclipse not free)
4. Java operating mechanism
Java programs must be written, compiled, and run in three steps. This is the Java source file (*.java)->java Compiler---bytecode file (*.class)->java interpreter.
5. Creation of the first Java program (two methods)
5.1. Direct method
(1), create a new *.java file (you can use Notepad to edit, change the suffix name), enter the code;
public class HelloWorld {public static void main (string[] args) {System.out.println ("Hello world!");}
(2), compile Javac Xxxx.java, run Java XXXX, correctly compile and output instructions to execute the program successfully, such as.
5.2. Eclipse Law
(1), File->new->java Project, enter MyProject, click Finish.
(2), under the MyProject project, right click on src to select New->file, create a new *.java file.
(3), input code, compile and run.
public class Welcome {public static void main (string[] args) {System.out.println ("Welcome to Java world!");}}
(4), the correct output results, as shown.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java Learning (i): Java Introduction and its platform, development environment configuration and construction