Java Learning Note 1--java Development Environment Platform Summary

Source: Internet
Author: User
Tags tools and utilities netbeans

This article address: http://www.cnblogs.com/archimedes/p/java-study-note1.html, reprint please indicate source address.

1.Java programming language

Java programming language is a high-level language, it uses our familiar words, sentences and other expressions need the computer to do things for us. Most programming languages are compiled or interpreted so that they can be run on the computer.

In the Java programming language, all source code is written in a plain text file with a. java extension. These source files are compiled into a. class file through the Java compiler (Javac.exe). The. class file does not contain the code of the local processor, but contains the Java Virtual Machine Machine language code, which is a platform-agnostic code interpreted by the interpreter on the Java platform, called a "bytecode".

The Java Execution Tool (Java) is used to run a. class file, which is an interpreter, also known as a "Java Virtual machine," that interprets the decomposition and executes each Java bytecode directive. Reflect this process:

Java Virtual machine, you can think of Java bytecode like a machine script. Any Java interpreter, whether it is a development tool or a Web browser running an applet, can be considered a running Java virtual machine. Java virtual machines are valid in many different operating systems, so the same. class files are capable of running on Windows, Solaris, Linux, MacOS, and many other operating systems.

2.Java Platform

The platform is the hardware and software environment in which the program runs. Some of the popular platforms we already know like Windows, Linux, Solaris, and MacOS. Most platforms are described as a complex of operating systems and hardware. Unlike other platforms, the Java platform is a software-only platform that runs on other hardware-based platforms, such as:

There are two parts of the Java platform:

Java Virtual machine (Java VM)

Java Application Interface (Java API)

Java Virtual machines are the foundation of the Java platform and are access ports on a variety of different hardware infrastructure platforms. The Java bytecode program is what it interprets and executes, while providing a running environment for the program.

The Java API is a huge, software-composed collection that provides a lot of useful functionality. The Java API is combined in a library, consisting of related classes and interfaces, which are called "packages". Represents a program running on the Java platform. The diagram shows that the Java API and the virtual machine isolate the program from the hardware, and the Java program runs through the API on the VM.

3.Java terminology

Jvm-java virtual Machines

The JVM translates Java bytecode programs into machine languages. It is then executed by the computer.

Jre-java Operating Environment

The JRE is composed of the JVM and Java platform core classes and related support files.

Api-application programming interface.

The API is rules (syntax): How to Program in Java technology.

The API includes hundreds of classes-the company's pre-programmed code that you can use to make the most of their functionality.

The Jdk-java Developer ' s kit (Java SDK) JDK contains the JVM and other tools, as well as all the APIs and related files. The JDK is the old name of Java technology (adopted before November 1999) and JDK1.1 is the last version.  New name for Java 2-java 2 platform,j2 Sdk–java technology. Sdk-software Development Kit4.java Virtual machine

The JVM provides the following definitions:

    • Instruction set (Bytecodes is the JVM's machine Directive).

    • Register Group

    • class file format

    • Stack

    • Garbage collection "Heap" (for dynamic allocation of memory and automatic recycling)

    • Memory Area

When the Java program executes, the virtual machine first loads the class file to be executed, then validates the bytecode, and finally interprets the bytecode with the interpreter, which is the logical construct of the JVM:

Load code-Class assembler

All of the classes required to run the loader. The class assembler separates the namespace of the class for the local file system from the namespace of the class from the network resource. This restricts the Trojan, because the local class is always loaded first.

Once all classes are loaded, the memory layout of the executable program is determined. The memory address is assigned to the symbol reference table, and the lookup table is established. Unauthorized access to the code domain is prevented because the layout of the memory appears at run time.

Verification code-Bytecode validator

The Java code undergoes several tests before it executes on your machine. The bytecode validator tests the format of the snippet, checks the code snippet for illegal code (forged pointers, illegal access on objects, attempts to change object types, and so on).

All network-class files are byte-code validated.

Execute code-Interpreter

5. Build the Java Platform and Development environment 1. Build a Java Platform

The creation of the Java platform can be done by installing the JDK or JRE only. The JRE is the Java runtime (Java Runtime Environment) abbreviation, and if it is used only to run Java programs, only the JRE will be installed. If you need to develop and run Java programs, you must install the JDK.

First step: Download the JDK.

Step two: Run the JDK Setup program.

The above two steps is relatively simple, do not repeat

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 ";".

Setting environment variables under Windows system can be added from System settings in Control Panel or environment variables, advanced system settings, computer, properties

Take JDK1.7 as an example of setting the environment variable, assuming that the installation path for the JDK installation is

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

On the command line, enter the following command:

Java-version

Displays the following version information, stating that the configuration was successful!

2. Build 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 a lot of integrated development environment, such as Jcreator,nebeans,java Studio,jbuilder,java workshop,jdeveloper,visual age for Java,eclipse and so on, Here's a brief introduction to NetBeans and Eclipse.

NetBeans IDE

NetBeans is a full-featured open source Java IDE that helps developers write, compile, debug, and deploy Java applications and incorporate versioning and XML editing into their many functions. NetBeans supports the creation of Java 2 Platform Standard Edition (J2SE) applications, the creation of a 2-tier Web application with JSPs and Servlets, and the creation of core groups of APIs and software for 2-tier Web applications. In addition, the latest NetBeans dispatch has two Web servers, Tomcat and GlassFish, which eliminates the tedious configuration and installation process. All of this creates a scalable, open-source, multi-platform Java IDE for Java developers to support their development efforts in their chosen environment, such as Solaris, Linux, Windows, or the Macintosh.

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 Learning Note 1--java Development Environment Platform Summary

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.