Ubuntu14.04 install JDK
System Information: 64-bit Ubuntu14.04
1. Download
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Installation 2
1. Create the installation directory jvm
Open the terminal and run the following command to create a folder jvm for installing jdk:
sudo mkdir /usr/lib/jvm
2. Decompress
Unzip the downloaded installation package: jdk-8u20-linux-x64.tar.gz to the newly created Directory:/usr/lib/jvm
sudo tar zxvf ./jdk-8u20-linux-x64.tar.gz -C /usr/lib/jvm
3. Switch to the installation directory and rename it to facilitate settings.
Cd/usr/lib/jvmsudo mv jdk1.8.0 _ 20/jdk 3 configuration Environment
Open the configuration file:
gedit ~/.bashrc
Add at the end of the file:
# jdk environmentexport JAVA_HOME=/usr/lib/jvm/jdkexport JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATHSave and exit. Enter the following command on the terminal to make it take effect:
source ~/.bashrc
4. Test
Enter the following command:
Java-version
If:
Java version "1.8.0 _ 20"
Java (TM) SE Runtime Environment (build 1.8.0 _ 20-b26)
Java HotSpot (TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
Then everything is OK