Install jdk-7u45-linux-x64.tar.gz in Linux

Source: Internet
Author: User

Download jdk-7u45-linux-x64.tar.gz

: Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. tar decompression: tar-xzvf jdk-7u45-linux-x64.tar.gz

Usually installed in the/usr/local/directory

3. Configure environment variables:

<span style="white-space:pre"></span>$ vi /etc/profile
<Span style = "white-space: pre"> </span> Add:
<span style="white-space:pre"></span>#set java environmentexport JAVA_HOME=/usr/local/jdk1.7.0_45export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
</Pre> <pre code_snippet_id = "367718" snippet_file_name = "blog_20140528_5_9233168" id = "best-answer-content" class = "reply-text mb10" name = "code" style = ""white-space: pre-wrap; word-wrap: break-word; color: rgb (51, 51, 51); line-height: 22px; background-color: rgb (255,252,246 ); margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: Arial; zoom: 1; "> 4. Make the configuration take effect:
<span style="white-space:pre"></span>source /etc/profile</span>
</Pre> <pre code_snippet_id = "367718" snippet_file_name = "blog_20140528_8_7204873" id = "best-answer-content" class = "reply-text mb10" name = "code" style = ""white-space: pre-wrap; word-wrap: break-word; color: rgb (51, 51, 51); line-height: 22px; background-color: rgb (255,252,246 ); margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: Arial; zoom: 1; "> 5. Check whether the installation is successful:
<span style="white-space:pre"></span>java -version
<Span style = "white-space: pre"> </span> If version information is displayed, the installation is successful:
<span style="white-space:pre"></span>java version "1.7.0_45"Java(TM) SE Runtime Environment (build 1.7.0_45-b18)Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)</span>
End.

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.