linux 安裝jdk-7u45-linux-x64.tar.gz

來源:互聯網
上載者:User

1、官網下載jdk-7u45-linux-x64.tar.gz

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


2、tar解壓:tar -xzvf jdk-7u45-linux-x64.tar.gz

一般安裝在/usr/local/目錄下


3、配置環境變數:

<span style="white-space:pre"></span>$ vi /etc/profile
<span style="white-space:pre"></span>在尾行添加:
<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、使配置生效:
<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、檢驗是否安裝成功:
<span style="white-space:pre"></span>java -version
<span style="white-space:pre"></span>出現版本資訊說明安裝成功:
<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>
結束。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.