Ubuntu14.04 install JDK and ubuntu14.04jdk
Download from Sun's official website
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Select accept license, and then select JDK download suitable for your model.
Decompress the file and modify the file name.
sudo mkdir /usr/lib/jvmsudo tar zxvf jdk-8u11-linux-i586.tar.gz -C /usr/lib/jvmcd /usr/lib/jvmsudo mv jdk1.8.0_11 java
Add Environment Variables
sudo vim ~/.bashrc
Add the following content
export JAVA_HOME=/usr/lib/jvm/java export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
Configure the default JDK version
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/bin/java 300 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/bin/javac 300 sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java/bin/jar 300 sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java/bin/javah 300 sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java/bin/javap 300
Then execute
sudo update-alternatives --config java
This is the first time JDK is installed.
There is only one alternative in link group java (providing/usr/bin/java):/usr/lib/jvm/java/bin/java requires no configuration.
If it is not the first installation, JDK options of different versions will be available.
Test
java -version
I am the dividing line of tiantiao
Reference: http://www.cnblogs.com/plinx/archive/2013/06/01/3113106.html
Ubuntu1404lts installation jdk-8u11-linux-i586targz problem !!
-Does the path after C exist? Write so much .. why, just absolute path/usr/lib/jvm.
How to install jdk in ubuntu 1204
Search for OpenJDK installation in the Software Center.
If you want to install the official JDK, you can download and install it on the official website. I personally think OpenJDK can fully meet your needs.