Java Chapter I----Java Overview + Environment building

Source: Internet
Author: User

written in the previous words:

Java Basics have been seen several times, but have been forgotten for a while, so this time I decided to spend some time sorting out a series of blogs for later convenience. This series according to Java programming thought +java Core technology two book , these two books are also I highly recommend you look at the two, because every time there is a different harvest, two horizontal look complementary will let you benefit, well, please look forward to it!

section I: Introduction to Java

  Java is an object-oriented programming language introduced by Sun Company in May 1995, which implements the object-oriented theory and pays more attention to the process of object itself without too much attention to events.

  Java is composed of the Java programming language +java class format file +java virtual machine +java Application interface, we define different class files through the IDE, by invoking the method of the class (Java API) to access the resource system, the source file compile the file into a. class and run the file from the Java Virtual machine.

  Java whitepaper:

  • Simplicity: The syntax is simple to understand, excluding the hard-to-understand header file pointers in C + +, the class library is small, but as the class library increases and the size of the thread supports object-oriented: Focus more on the object itself rather than on the implementation process.
  • Network skills: Java's network capabilities are simple and easy to use, dealing with TCP/IP protocols such as HTTP or FTP, allowing you to open or Access objects on the network through URLs.
  • Robustness: Java's strong typing mechanism, exception handling, and garbage collection are important guarantees of Java program robustness. Java uses a pointer model to eliminate the possibility of rewriting memory and corrupting data, and Java does not need to use pointers to construct structures such as string arrays, but if necessary Java also has pointer capabilities such as: linked lists.
  • Security: Java has no pointers, so programmers can't get the hidden insider and forge pointers to the memory. More importantly, the Java compiler does not handle storage scheduling decisions, so programmers cannot guess the actual storage schedule of classes by looking at the claims. Stored references in compiled Java code are at runtime determined by the Java interpreter to actually store the address.
  • Portability: Java makes language declarations independent of the implementation aspect. For example, Java explicitly describes the size of each base data type and its operational behavior (these data types are described by Java syntax). The Java environment itself is portable for new hardware platforms and operating systems. The Java compiler is also written in Java, while the Java runtime system is written in Ansic language.
  • Explanatory: Java programs are compiled into bytecode format on the Java platform and can then be run on any system that implements the Java platform. At runtime, these bytecode are interpreted by the Java interpreter in the Java platform, and the classes required during execution are loaded into the runtime environment during the join phase.
  • High performance: Java programs can run on any system that implements the Java interpreter and running system (Run-time systems).
  • Multithreading: Multithreading can lead to better interactive responses and user behavior.
  • Dynamic: The Java language is designed to adapt to a changing environment, which is a dynamic language. For example, classes in Java are loaded as needed, and even some are obtained over the network.
section II: History of Java
  1. 1991 Sun is preparing to develop a device similar to that of a cable TV conversion box, the project named: Green. The code is short and compact and platform-independent, designing a virtual machine-generated intermediate code portability language based on the Pascal language, the Java virtual machine
  2. 1994 Green Project (first Pascal company) disbanded
  3. May 23, 1995 Java was demonstrated on Sunworld, the great Java language was born
  4. At the beginning of 1996, Sun released the first version of Java, but the Java1.0 version was not actually applied in development.
  5. December 1998 release of the Java1.2 version (Standard Edition-j2se-javase), this version is closer to Java in a write-anywhere concept, released three days later (mini version-j2me-javame) and (Enterprise Edition-j2ee-javaee)
  6. 2000 released Java1.3
  7. 2002 Released Java1.4
  8. 2004 Java has made significant improvements to the language that can be described as another major milestone, officially named Java5.0, and added concepts such as generics, foreach loops, enumerations, etc.
  9. 2006 release of Java version 6
  10. 2009 Sun, once a glorious day, the empire finally fell, after Oracle acquisition of Java into a period of stagnation
  11. 2011 release of Java version 7
  12. 2014 release of Java version 8
Section III: Building the Java Development environment
    • JDK (Java development Kit): Software used by programmers who write Java programs
    • JRE: Software used to run Java programs
    • IDE: Integrated development Environment: eclipse, IDEA, etc.

Jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html. Note: Installation default path is under Program files, it is best to replace the path or change the space to avoid unnecessary trouble.

Directory structure:

      • Bin: relational database files developed by compiler and tool Db:java
      • Include: The file used to compile the local method
      • Javafx-src:javafx script is a declarative, statically typed programming language
      • Jre:java Running Environment files
      • LIB: Class library file
      • SRC: Class Library source file

Environment variable configuration:

Java_home:d:\java\jdk1.8.0_31 it points to the JDK's installation directory, and Eclipse/netbeans/tomcat software is to find and use the installed JDK by searching for java_home variables.

Path:%java_home%\bin; The function is to specify the command search path, execute the command below the command line, such as Javac compiling the Java program, it will look in the path specified by the paths variable to see if the corresponding command program can be found. We need to add the bin directory in the JDK installation directory to the existing path variable, and the bin directory contains the frequently used executables such as Javac/java/javadoc wait, and after setting the path variable, you can execute the Javac/java tool in any directory.

CLASSPATH:.; The%java_home%/lib/dt.jar;%java_home%/lib/tools.jar function is to specify a class search path, and to use a class that has already been written, the premise is to be able to find them, and the JVM is looking for classes through classpath. We need to set the Dt.jar and Tools.jar in the Lib subdirectory of the JDK installation directory to classpath, of course, the current directory "." must also be added to the variable.

environment variable Validation:

CMD validation: Enter Java-version and then enter the console output JDK version number to indicate that the installation was successful.

Create a new Helloworld.java file, enter the appropriate directory input Javac Helloworld.java then enter the Java HelloWorld and then return to the console output Hello World description of the environment variable configuration succeeded.

Note: The JAVAC program is a Java compiler that compiles helloworld.java into helloworld.class files and sends them to a Java virtual machine where the virtual machine executes the bytecode that the compiler puts in the class file.

Note: Compile-time needs to provide the file to be compiled suffix name: Helloworld.java, and the runtime only need to set the class name on it, do not need to have a suffix: HelloWorld.

Java Chapter I----Java Overview + Environment building

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.