码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2014-06-05 12:01:30      阅读:470      评论:0      收藏:0      [点我收藏+]

标签:linux   jdk   

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 environment
	export JAVA_HOME=/usr/local/jdk1.7.0_45
	export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
	export 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>
结束。


linux 安装jdk-7u45-linux-x64.tar.gz,布布扣,bubuko.com

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

标签:linux   jdk   

原文地址:http://blog.csdn.net/duyuanhai/article/details/27370373

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!