JAVA Learning (1): Java introduction, configuration and Setup of its platform and development environment, and java Construction

Source: Internet
Author: User

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.

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.