Java Learning (i): Java Introduction and its platform, development environment configuration and construction

Source: Internet
Author: User

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

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.