Installation environment operating system: Ubuntu14.04.1serveramd64 download jdkwgethttp: // download.Oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz? AuthParam = 1412395049_5ee2894e196e935ec18e4b2a6236bf28 rename the mv installation environment
Operating System: Ubuntu 14.04.1 server amd64
Download jdk
wget http://download.Oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz?AuthParam=1412395049_5ee2894e196e935ec18e4b2a6236bf28
Rename
mv jdk-7u67-linux-x64.tar.gz\?AuthParam\=1412395049_5ee2894e196e935ec18e4b2a6236bf28 jdk-7u67-linux-x64.tar.gz
Extract
tar -xzf jdk-7u67-linux-x64.tar.gz
Set Environment Variables
Environment variables include user variables and system variables.
User variable configuration file :~ /. Bashrc (the hidden files in the current user's home directory can be viewed through 'LS-)
System Environment configuration file:/etc/profile
User variables are configured in the same way as system variables. This document uses user variables as an example.
Edit the configuration file. bashrc:
vi .bashrc
Append at the end of the file:
# set java environmentexport JAVA_HOME=/home/Hadoop/jdk1.7.0_67export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATHexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
Make environment variables take effect
source .bashrc
Verify
Verify that java is successfully installed.
$ java -versionjava version "1.7.0_67"Java(TM) SE Runtime Environment (build 1.7.0_67-b01)Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment VariablesHttp://www.linuxidc.com/Linux/2015-01/112030.htm
Ubuntu 14.04 LTS install Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm
CentOS6.3 install JDK and environment configuration http://www.linuxidc.com/Linux/2012-09/70780.htm
Ubuntu 14.04 install JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm
Install JDK graph analysis http://www.linuxidc.com/Linux/2014-09/107291.htm under Ubuntu
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-03/114618.htm