1 overview
This article mainly introduces the basic knowledge of Java
2 Basic Content
2.1 Introduction to programming languages
Hardware level: Microcode programming, assembly language
System level: c,c++, ...
Application level: java,php, Python, Ruby, Perl, C #, ...
Python:pvm
Standard Library
Web Framework:django,flask, ...
Java:jvm,jdk
Bash:bash Explainer
Program: Instruction + data
Program programming: Command-centric, data services in code;
Object-Oriented Programming: data-centric, Directive service to data;
Objects, methods (method)
2.2 Java History
The Java development process is as follows
1995:java1.0, Write once, Run Anywhere;
1996:JDK (Java Developmentkit), containing class libraries (APIs), development tools (Javac), JVM (SUN Classic VM)
JDK 1.0, APPLET,AWT
1997:JDK 1.1
1998:JDK 1.2
Sun splits Java technology into three directions:
J2se:standardedition
J2ee:enterpriseedition
J2me:mobileedition
Representative Technology: Ejb,java plugin, Swing,jit (Just in Time, instant compilation)
2000:JDK 1.3
HotSpot VMS
2002:JDK 1.4
2006:sun Open source Java technology, the GPL, the establishment of a known as OPENJDK organization;
Java 2 SE, Java 2 EE, Java 2 ME
2011:JDK 1.7
2014:JDK 1.8
2016:JDK 1.9
2.3 Running Java code
*.java (source code)--Javac-->*.class (bytecode)
Jvm:classloader, the class file of the loader, and the other class files to which the program's class file is dependent, then run; the entire run is represented as a JVM process;
. JSP-->jasper-->. Java--Javac-->.class---JVM
The code in JSP format is Jasper into. Java and then converted from Javac to. class format, loaded on the JVM virtual machine to run
Note: The output of the static output data to Java code based on Jasper, the result is the code of the servlet specification;
2.4 Java Technology System:
Java programming language
Java class file format
Java API
Java VMS: running Java code
Class Loader
Execution engine
JVM Run-time zone
Method Area: Thread sharing, used to store class information, constants, static variables, methods, etc. loaded by the JVM;
Heap: Is the largest part of the memory occupied by the JVM, and also the main area of GC management; storage object;
Java stack: Thread private, store thread's own local variables;
PC Register: Thread Private memory space, program instruction pointer;
Local method Stack:
2.5 Installing the JDK
Version has 1.6.0,1.7.0, 1.8.0 currently 8 is the mainstream version, so the experiment here are installed 8 version, multi-version coexistence, you can use the alternatives command to set the default version;
Note: After the installation is complete, to configure the Java_home environment variable, point to the Java installation path
OpenJDK:
Java_home=/usr
Oracle JDK:
Java_home=/usr/java/jdk_version
Java 2 EE:
Cgi:common Gateway Interface
Understanding the current Java environment, executing the command: java-version
2.5.1 Local Yum Installation
The Yum Warehouse is OPENJDK (open javadevelopment Kit) and is installed directly with Yum:
Yum Install Java-1.8.0-openjdk-devel
2.5.2 Oracle JDK:
Install the appropriate version of the RPM package; jdk-version-os-arch.rpm
Oracle Official download is the official JDK, the website found the package jdk-8u151-linux-x64.rpm, download link: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/ e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm
Introduction to JDK-8U151-LINUX-X64.RPM Package installation
RPM-IVH jdk-8u151-linux-x64.rpmvim/etc/profile.d/java.shexport java_home=/usr/java/latestexport PATH= $JAVA _home/ bin:/$PATH
Run after saving. /etc/profile.d/java.sh
The default version, latest is the latest version, which is specified as the latest version.
Java-version View Java version
Example: jdk-1.8.0_25-linux-x64.rpm
2.6 Servlet
To enable the Web server to collaborate with two different software systems for Web applications, a standard interface is required, and the servlet is one of the main interfaces.
class library; web App;
servlet container, servlet Engine
Jsp:java Server Page
Class Library:
JSP Container:
JSP + Servlet Container
Java Web Server:jws
Asf:jserv
2.7 Java Container
Business implementation
WebSphere, WebLogic, oc4j, Glassfish, Geronimo, Jonas,jboss, ...
WebSphere, takes up 40% of the share
WebLogic, takes up 30% of the share
JBoss, it's Red hat now.
Open Source Implementation
Tomcat, Jetty, Resin, ...
Tomcat: Written by the Java language, so you need to run the JVM, run up to Java programs, receive user requests, parse HTTP
Jetty, lightweight, very important when resources are scarce.
Resin Multi-Authorized distribution
This article is from the "Sunshine Ops" blog, please be sure to keep this source http://ghbsunny.blog.51cto.com/7759574/1982270
A brief introduction to the Java Knowledge Point of Tomcat