Ubuntuinstall jdk(tar.gz)

Source: Internet
Author: User

If no root user is created:

1 sudo passwd root

 

Download JDK (Baidu "JDK" character tar.gz package: jdk-7u55-linux-x64.gz this is the version I downloaded, the name of the specific version of the prevail to switch to the root:
1 su - root

 

Decompress the file:

1 gunzip jdk-7u55-linux-x64.gz2 tar -xf jdk-7u55-linux-x64

Get the jdk1.7.0 _ 55 folder.

 

Move to/USR:

1 mv jdk1.7.0_55 /usr

 

Set environment variables:

1 gedit /etc/profile

Add at the end:

1 export JAVA_HOME=/usr/jdk1.7.0_552 export JRE_HOME=/usr/jdk1.7.0_55/jre3 export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH4 export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

 

Modify the default JDK:

1 update-alternatives --install /usr/bin/java java /usr/jdk1.7.0_55/bin/java 3002 update-alternatives --install /usr/bin/javac javac /usr/jdk1.7.0_55/bin/javac 300

 

View the JDK version:

1 java -version

Ubuntuinstall jdk(tar.gz)

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.