Manual installation and configuration of the Java environment

Source: Internet
Author: User
Tags java reference

Manual installation and configuration of the Java environment

1. Theoretical Basis
1.1 Related Concepts
JDK-the abbreviation of Java Development Kit. It is a product for Java developers and is the core of Java, including the Java Runtime Environment JRE, Java tools, and Java base class libraries.
JRE-is the abbreviation of Java Runtime Environment. It is a set of environments required to run JAVA programs, including JVM standard implementation and Java core class libraries.
JVM is the abbreviation of Java Virtual Machine (java Virtual Machine). It is the core of cross-platform implementation in Java and can run software programs written in Java.
1.2 correlation

As shown in:
1) JVM-JVM is called a JAVA virtual machine. It is responsible for parsing the java bytecode (*. class file) and is the lowest layer of the JAVA architecture.
2) JRE-is based on JVM Virtual Machine + additional JRE class library
3) JDK-a JAVA Development Tool + JRE environment based on some columns
Note: JRE class library must be called when JVM parses a JAVA bytecode File
1.3. JDK directory structure

As shown in:
1) JDK root directory-the official recommended absolute path is as follows:
/Usr/java/jdk1.7.0 _ 80/

2) The jre root directory is located in the JDK and directory. The absolute path is as follows:
/Usr/java/jdk1.7.0 _ 80/jre

3) The jre class library is located in the jre and directory. The absolute path is as follows:

/Usr/java/jdk1.7.0 _ 80/jre/lib

4) The JVM root directory is located in the jre root directory. The absolute path is as follows:
/Usr/java/jdk1.7.0 _ 80/jre/bin

1.4. JDK system environment variable definition
Refer to the JDK directory structure. Therefore, the four system environment variables during JAVA runtime are defined as follows:
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 80/
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH

Note: For specific settings, see the Practice section.
2. Practice
2.1 Environment
Hostname = java.cmdschool.org
Ipaddress = 10.168.0.x
2.2 download JDK
1) download JAVA (newer java)
Http://www.java.com/zh_CN/download/manual.jsp
2) JAVA file (download the old java version)
Http://www.Oracle.com/technetwork/java/javase/archive-139210.html
2.3 configure JDK
2.3.1 create a java directory
Mkdir/usr/java

2.3.2. Decompress
Cd/usr/java
Tar zxvf jdk1.x.x_xx.tar.gz
Cd jdk1.x. x_xx

2.3.2 configure Environment Variables

Vim/etc/profile

Add the following content at the end:
Export JAVA_HOME =/usr/java/jdk1.x. x_xx
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH

NOTE: If only one user's environment becomes effective, write the configuration in the following file:
1 vim ~ /. Bashrc

2.3.3. Configuration takes effect
Source/etc/profile

2.3.4 Test Environment Variables
Java-version

Reference:
1) download JAVA (newer java)
Http://www.java.com/zh_CN/download/manual.jsp
2) JAVA file (download the old java version)
Http://www.oracle.com/technetwork/java/javase/archive-139210.html
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
3) official installation tutorial for JAVA

Basic installation:
Http://www.java.com/zh_CN/download/help/linux_install.xml
Environment Variable Configuration:
Http://www.java.com/zh_CN/download/help/path.xml
4) unofficial JAVA reference


5) JAVA uninstall
Http://www.java.com/zh_CN/download/help/linux_uninstall.xml

 

Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables

JDK introduction & JDK environment variable settings in Linux

Build a JDK environment using CentOS

Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables

Install Oracle JDK 14.04 on Ubuntu 1.8 LTS

CentOS6.3 install JDK and environment Configuration

Install JDK 8 on Ubuntu 14.04

Install JDK graph analysis in Ubuntu

This article permanently updates the link address:

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.