Linux CentOS installation JDK

Source: Internet
Author: User

The content is simple ~ ~ ~ The new person asks for care ~ ~

How to install JDK under CentOS-this is centos6.5.

1. First check to see if the current installed CentOS comes with a JDK

--View JDK version: Java-version

--Use the command to see if it comes with Jdk:rpm-qa | grep java

--Unload your own jdk:rpm-e--nodeps [JDK inside the virtual machine]

EG:RPM-E--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64

2. Start the installation

(1). Install dependencies required for installation of JDK

--Yum Install glibc.i686

(2). Unzip the pre-prepared JDK, no JDK can be downloaded from CentOS

--CentOS Download Jdk:wget http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

--Unzip the JDK to the/usr/local directory: TAR–XVF xxx.tar.gz-c/usr/local

(3). Configure Environment Variables Vi/etc/profile

Method One:

Added under Export PATH USER LOGNAME MAIL HOSTNAME histsize Histcontrol
Export java_home=/usr/local/jdk* (JDK directory name)/
Export path= $JAVA _home/bin: $PATH

Method Two:

java_home=/usr/local/src/java/jdk*
Path= $JAVA _home/bin: $PATH
Export Java_home PATH

(4). Reload the configuration file

--Use command: Source/etc/profile

(5). Check if the JDK version is installed successfully!

Linux CentOS installation JDK

Related Article

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.