Java Basic Learning (a)--language features and development environment construction

Source: Internet
Author: User
Tags tools and utilities java web java se

Learn Java for a period of time, want to pass a few articles to do this period of study summary. The Java language is generally very affinity because of the basic features of C + +. Although often to the blog park to find information, but also has not written their own blog, now practice practiced hand, also for the future have a memory it.

One, Introduction to Java 1. Language origin

Language Origin: Java is a high-level programming language introduced in 1995 by Sun (Stanford University Network Stanford University web Company). Java name Source Java was originally named Oak, the target of small-scale systems such as household appliances programming language, as the market changes, sun focused on the development of Web applications. Java is the source of the name: Java is the English name of the Indonesian island of Java, known for its rich coffee.

2. Cross-platform ① of language features

What is a cross-platform (computer system), cross-platform concept is an important concept in software development, that is, do not rely on the operating system, but also do not trust the hardware environment. Applications developed under one operating system can still run under another operating system.

②java Cross-platform

"Write Once run Anywhere"

Java's cross-platform is relative to other programming languages, and applications written in the Java language can run on different system platforms. General high-level languages if you want to run on a different platform, you need to compile at least a different target code. In Windows compiled C language program, under Linux is not able to run. Of course, the C language program compiled under Linux will not work under Windows. The Java language does not need to be recompiled when it runs on different platforms.

Java Cross-platform principle: Java's cross-platform is implemented through the Java Virtual Machine (JVM).

③java virtual Machine (JVM)

Java Virtual Machine A software simulation of the computer. The Java source program is imagined as our C source program, and the bytecode (. Class) generated by the Java source program is equivalent to the compiled binary executable file of the C source program. The JVM virtual machine is equivalent to a computer system (operating system + hardware environment) and the Java interpreter is CPU.

. exe files run directly under the Windows operating system and are machine code (. exe files) running on the CPU

The. Class bytecode file is run under the JVM virtual machine, and Java bytecode is running on the Java interpreter.

The Java interpreter is equivalent to "CPU" running Java bytecode, but the "CPU" is implemented by software instead of hardware. The Java interpreter is actually an application under a particular platform. As long as the interpreter program under a specific platform is implemented, Java bytecode can be run through the interpreter program on the platform, which is the root of the Java cross-platform. Currently, not all platforms have a corresponding Java interpreter program, which is why Java does not work on all platforms, it can only run in the implementation of the Java Interpreter program platform.

Three big platforms for 3.Java

Javase

Java SE (Java platform,standard Edition). Java SE was formerly known as J2SE. It allows you to develop and deploy Java applications that are used in desktops, servers, embedded environments, and live environments. Java SE contains classes that support Java WEB Service development and provides the foundation for Java platform,enterprise Edition (Java EE).
Example: A desktop application like QQ.

Java EE

Java EE (Java platform,enterprise Edition). This version was formerly known as the Java EE. The Enterprise Edition helps develop and deploy portable, robust, scalable, and secure server-side Java applications. Built on the Java SE, Java EE provides Web services, component models, management, and communication APIs that can be used to implement enterprise-class service-oriented architecture (service-oriented Architecture,soa) and Web 2.0 applications.

Java ME

Java ME (Java platform,micro Edition). This version was formerly known as J2ME, also called K-java. Java ME provides a robust and flexible environment for applications running on mobile devices and embedded devices such as mobile phones, PDAs, TV set-top boxes, and printers. Java ME includes a flexible user interface, robust security model, many built-in network protocols, and rich support for Web and offline applications that can be dynamically downloaded. Applications based on the Java ME specification need to be written once, can be used for many devices, and can take advantage of the native capabilities of each device.

About the Java Baidu Encyclopedia: http://baike.baidu.com/link?url= mh4zzbgvpsy6ljkahwcmwojphvay50bf8oh6cza3i7vwjw7k2hwb5znemm8vz6jpdrd_w81px-tmmazhfdq7ekkaviohc52384kju0q6e9m

Second, the development environment of the building 1. About JDK

The JDK (Java development Kit) is a product of Sun Microsystems for Java developers. Since Java was launched, the JDK has become the most widely used Java SDK. The JDK is the core of the entire Java, including the Java Runtime Environment, Java tools, and the Java base Class library. Starting with Sun's JDK5.0, it provides a very useful feature such as generics, and its version is constantly updated and its operational efficiency has been greatly improved.

2.JDK Catalogue Introduction
    1. Bin directory: A compiler, interpreter, and other tools (executables) that store java.
    2. DB directory: JDK7 comes with a lightweight database named Derby.
    3. Include directory: an interface file that holds the calling system resource.
    4. JRE Directory: Store Java Runtime Environment files.
    5. LIB directory: A class library file that holds java.
    6. Src.zip file: The source code for the class provided by the JDK.

Things to keep in mind when installing a JDK:

    1. Do not include Chinese in the installation path .
    2. Do not include spaces in the installation path.
3.JRE Introduction

JRE Java Runtime Environment Java operating environment. including Java virtual machines (JVM Java) and the core class libraries required by Java programs, if you want to run a well-developed Java program, you only need to install the JRE on your computer.

4. Configure the PATH environment variable

First step: Download the JDK.

Step two: Run the JDK Setup program.

Step three: Set the JDK environment variable.

It is common to set the Java environment variable path and CLASSPATH after the JDK installation is complete.

(1). Path variable

Is the directory set used by the operating system to find the executable file in the following format:

Path=<path The original content >;<jdk installation directory >\bin

After the JDK installation is complete, you need to add the directory of the development tools to the path variable so that the operating system can find the compiler javac or interpreter Java when compiling or executing the Java program.

(2). Classpath variable

Is the directory set that the Java compiler compiles to find related classes or interfaces, and is the directory set used by the Java interpreter to find related classes or interfaces in the following format:

Classpath=<class file directory > or <jar file path name >[; ...]

Here < The path name of the jar file > consists of each jar file and the directory name that holds it, for example

D:\Program Files (x86) \java\jdk1.7.0_07\lib\dt.jar

Multiple path names are separated by ";".

5. Building a Java development environment

After the Java platform is established (that is, installing the JDK), you can run or develop the Java program. The JDK provides basic Java development tools, which are placed in the bin directory under the JDK installation directory. However, the complexity of large Java programs is not enough to meet the requirements, the need for specialized integrated development tools. The following describes the JDK provides the main tool software, and the common integrated development tools to do a brief introduction.

(1) JDK Development tools

JDK development tools include tools and utilities to help develop, execute, debug, and save programs written in the Java programming language. The main tools in these programs are: Compile tool javac, explain tool Java, document Generation tool, Java Platform Debugging tool, etc.

Javac

java compiler, compile Java source program into bytecode, generate class file. In the bin directory, the file name is Javac.exe. Command format:

Javac [Options] source file [class] [@argfiles]

which

Option –-compile parameters.

SOURCE file--one or more Java source program files that need to be compiled.

Class –-one or more classes.

@argfiles-parameter file.

Use example: Compile Java source program Helloworld.java.

Java interpreter, executes the Java application directly from the class file, namely application. Command format:

java [Options] class [Parameters ...]

java [options]-jar jar file [parameters ...]

JAVAW [Options] class [Parameters ...]

JAVAW [options]-jar jar file [parameters ...]

which

Options-run parameters.

Class-The name of the class being called.

-jar jar file-the name of the jar file that was called.

Parameter--Pass to the argument string of the Main method.

Use Example: Execute Java class Hello.class

(2) Java Integrated development tools

An integrated development environment (abbreviated to the IDE and integrated development environment) is an application for the provider development environment, typically including code editors, compilers, debuggers, and graphical user interface tools. is the integration of code writing functions, analysis functions, compile functions, debugging functions and other integrated development software service sets. All software or software sets (groups) with this feature can be called an integrated development environment, can be run independently, and can be used with other programs. Java has many integrated development environments, such as Jcreator,nebeans,java Studio,jbuilder,java workshop,jdeveloper,visual age for Java,eclipse and so on. Introduction to eclipse as an example.

Eclipse

Eclipse is a well-known, cross-platform, free-integrated development environment (IDE). It was originally used primarily for Java language development, but it is now being developed as a tool for development in other languages such as C + +, Python, PHP, and so on. Eclipse itself is only a framework platform, and the support of many plugins makes it difficult for eclipse to have the flexibility of other functionally relatively fixed IDE software. Many software developers develop their own IDES in the framework of Eclipse.

The operation of Eclipse requires the presence of a Java virtual machine, and no additional compilers are required to compile java. The Java source code can be compiled on its own. Because Eclipse is written in Java, it works well across platforms, and the common platform eclipse can run.

The biggest feature of Eclipse is that plug-ins are used to extend the user's own needs, and the Eclipse source code is open, increasing the number of plug-ins, including some very good plugins. It also makes eclipse much more powerful, and there are a lot of software developed using Eclipse as a foundation.

Java Basic Learning (a)--language features and development environment construction

Related Article

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.