JAVA Learning (1): Java introduction, configuration and Setup of its platform and development environment, and java Construction
Java introduction, platform, and development environment configuration and Setup
1. Introduction to Java
Java is an object-oriented programming language with many features such as cross-platform, portable, distributed, simple, and scalable. Java can be used to develop desktop applications, Web applications, distributed systems, and embedded applications.
Java contains three different versions, namely, j2e-j2ee/J2SE (Microsoft version/Enterprise Edition/Standard Edition ).
2. Download, install, and configure JDK
(1), JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
(2) Configure JDK: Two environment variables must be configured: PATH and CLASSPATH (Case Insensitive ). As shown in:
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 JDK is configured successfully. That is, Enter cmd in the DOS environment, enter java-version, and press Enter. If the output content is shown, the configuration is successful.
3. Download and install Eclipse
Eclipse: http://www.eclipse.org/downloads/ (extract directly, run the application .)
Or
MyEclipse: http://downloads.myeclipseide.com/(MyEclipse is not free)
4. Java operating mechanism
The Java program must be compiled, compiled, and run in three steps. That is, the Java source file (*. java)-> Java compiler-> bytecode file (*. class)-> Java interpreter-> Run.
5. Create the first java program (two methods)
5.1. Direct Method
(1) create a *. java file (you can edit it in notepad and change the suffix) and enter the code;
public class HelloWorld {public static void main(String[] args) {System.out.println("Hello World!");}
(2) Compile javac XXXX. java and run java XXXX. correct compilation and output indicate that the program is successfully executed, as shown in.
5.2 Eclipse Method
(1), File-> New-> Java Project, enter MyProject, and click Finish.
(2) Right-click src under the MyProject project and choose New> File to create a *. java File.
(3) enter the code and compile and run it.
Public class Welcome {public static void main (String [] args) {System. out. println ("Welcome to JAVA world! ");}}
(4) correctly output the result, as shown in.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.