Ubuntu14.04 install JDK and ubuntu14.04jdk

Source: Internet
Author: User

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.

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.