In linux, configure and install the java jdk graphic process.

Source: Internet
Author: User

In linux, configure and install the java jdk graphic process.

First, check the system version. In this example, the operating system is CentOS 6.5:

If you are an operating system after initial installation, it is possible that the wget component does not exist, so you need to install it, in this way, you can get down the installation package from the Internet:

The figure above shows whether you have installed the wget component. If not, use the following statement to install it:

# Yum install-y wget

Of course, if you do not check, the command not found error will be reported when you directly execute wget;

After installation, download the jdk package:

# Wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz


 

JDK installation Configuration: 

After downloading, first install and configure java, find the location where your java installation package is downloaded, and then execute the following command:

# Tar-zxvf jdk-8u91-linux-x64.tar.gz

After the command is executed, a directory with the same name will appear in your same folder,

Then let's change the name of the new directory to a simple one, so that your memory will be much more convenient when you configure jdk later.

Enter the following command line:

# Mv jdk1.8.0 _ 91 jdk8

The result is as follows:

After the name is changed, we start a very important configuration process to configure the system environment variables of jdk:

Open the environment variable file and modify the configuration:

# Vi/etc/profile

 

Add the following code:

JAVA_HOME =/data/jdk1.8.0 _ 91
JRE_HOME =/data/jdk1.8.0 _ 91/jre
PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATHCLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: /root/bin
Export JAVA_HOME JRE_HOME CLASSPATH PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

 

When you open the variable file for the first time, you will find a statement like "export path user logname mail hostname histsize histcontro" already exists:

So what does it mean? The two or three sentences are too complex to understand, but the basic meanings are explained as follows:

PATH: determines the directory to which shell will look for commands or programs HOME: current user's main directory MAIL: refers to the current user's MAIL storage directory. SHELL: The Shell used by the current user. HISTSIZE: the number of historical Command records. LOGNAME: The Login Name of the current user. HOSTNAME: indicates the host name. If host names are used by many applications, they are usually obtained from this environment variable. LANG/LANGUGE: it is a language-related environment variable. Users in multiple languages can modify this environment variable. PS1: A Basic prompt. For root users, it is # And for common users, it is $. PS2: A subsidiary prompt. The default value is "> ".

Comment out the existing export statement and replace it with the one in the above Code. If they are not commented, they can also exist at the same time, but they have not been tested for any other impact, and are not sure;

 

After environment variables are configured, such:


Then execute the following statement to make it take effect immediately:

# Source/etc/profile

 

Next, test whether the java jdk configuration is successful. Enter the following statement:

# Java-version

 

The following information indicates that your jdk has been configured successfully:

 

 

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.