Ubuntu14.04 install Oracle JDK
Install Oracle JDK 6, 7, or 8 on Ubuntu 14.04.
Preparation: add-apt-repository Tool
#apt-get install python-software-properties
#apt-get install software-properties-common
Step 1: Add PPA repository to the System
#add-apt-repository ppa:webupd8team/java
Step 2: Update
#apt-get update
Step 3: download and install JDK
#apt-get install oracle-java6-installer
JDK 6 is installed here. If you want to install JDK 7 or JDK 8, change 6 in the preceding statement to the corresponding number.
Step 4: Set to default (skip this step if JDK of another version is not installed)
#apt-get install oracle-java6-set-default
Similarly, you need to change 6 to the corresponding 7 or 8.
Step 5: view the version
#java -version
Step 6: Set Environment Variables
Add the following content to the end of the/etc/profile file:
#vi /etc/profile
Add at the end of the file
#jdkexport JAVA_HOME=/usr/lib/jvm/java-6-oracleexport JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
To set the installed JDK to the default JDK version, perform the following operations.
Run the Code:
#update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-oracle/bin/java 300
#update-alternatives --config java
Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables
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: