CentOS-6.3安装配置JDK-7

浏览: 4362
安装说明
安装环境:CentOS-6.3
安装方式:rpm安装
软件:jdk-7u45-linux-x64.rpm
安装位置:/usr/java
下载地址:http://www.oracle.com/technetw ... .html

检验系统原版本
[root@admin ~]# java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)



进一步查看JDK信息:
[root@admin ~]# rpm -qa | grep java
tzdata-java-2012c-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64



卸载OpenJDK,执行以下操作:
[root@admin ~]# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch
[root@admin ~]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64



安装JDK
上传新的jdk-7u45-linux-x64.rpm软件到/usr/local/执行以下操作:
[root@admin local]# rpm -ivh jdk-7u45-linux-x64.rpm



JDK默认安装在/usr/java中。

验证安装
执行以下操作,查看信息是否正常:
[root@admin bin]# java
[root@admin bin]# javac
[root@admin bin]# java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)



恭喜,安装成功!

配置环境变量
其实安装完jdk-7u45-linux-x64.rpm后不用配置环境变量也可以正常执行javac、java –version操作,因此一般情况下没有必备进行JDK环境变量的配置。但是为了以后的不适之需,这里还是记录一下怎么进行配置,操作如下:
修改系统环境变量文件
vi + /etc/profile 
JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

//如果拷贝的直接是JDK文件到Linux服务器上面的话,记得修改bin目录下的可执行文件
chmod 751 /usr/local/jdk/bin/*
chmod 751 /usr/local/jdk/jre/bin/*




使修改生效
[root@admin local]# source /etc/profile   //使修改立即生效 
[root@admin local]# echo $PATH //查看PATH值



查看系统环境状态
[root@admin ~]# echo $PATH
/usr/local/cmake/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0/bin:/usr/java/jdk1.7.0/jre/bin:/root/bin


推荐 0
本文由 梁勇 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

1 个评论

大侠,我安装为什么出这个错误啊
error: open of <html> failed: No such file or directory
error: open of <head> failed: No such file or directory
error: open of <title>Unauthorized failed: No such file or directory
error: open of Request</title> failed: No such file or directory
error: open of <META failed: No such file or directory
error: open of NAME=ROBOTS failed: No such file or directory
error: open of CONTENT=NOINDEX, NOFOLLOW> failed: No such file or directory
error: open of <link failed: No such file or directory
error: open of rel=stylesheet failed: No such file or directory
error: open of type=text/css failed: No such file or directory
error: open of href=/errors/us/assets/hp-styles.css failed: No such file or directory
error: open of /> failed: No such file or directory
error: open of <link failed: No such file or directory
error: open of rel=stylesheet failed: No such file or directory
error: open of type=text/css failed: No such file or directory
error: open of href=/errors/us/assets/master-master.css failed: No such file or directory
error: open of /> failed: No such file or directory
error: open of <body failed: No such file or directory
error: open of style=margin: 0px failed: No such file or directory
error: open of bgcolor= failed: No such file or directory
error: open of <div failed: No such file or directory
error: open of id=banner> failed: No such file or directory
error: open of <table failed: No such file or directory
error: open of width=100% failed: No such file or directory
error: open of border=0 failed: No such file or directory
error: open of cellspacing=0 failed: No such file or directory
error: open of cellpadding=0> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of rowspan=2 failed: No such file or directory
error: open of valign=middle failed: No such file or directory
error: open of nowrap><a failed: No such file or directory
error: open of href=http://www.oracle.com><img failed: No such file or directory
error: open of src=/errors/us/assets/oralogo-small.gif failed: No such file or directory
error: open of width=154 failed: No such file or directory
error: open of height=19 failed: No such file or directory
error: open of hspace=10 failed: No such file or directory
error: open of vspace=25 failed: No such file or directory
error: open of border=0 failed: No such file or directory
error: open of ></a></td> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of align=right failed: No such file or directory
error: open of valign=top failed: No such file or directory
error: open of width=70% failed: No such file or directory
error: open of nowrap failed: No such file or directory
error: open of class=padMid><div failed: No such file or directory
error: open of id=bannerMid> failed: No such file or directory
error: open of </div></td> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of width=30% failed: No such file or directory
error: open of align=left failed: No such file or directory
error: open of valign=bottom failed: No such file or directory
error: open of nowrap></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of align=right failed: No such file or directory
error: open of valign=bottom failed: No such file or directory
error: open of nowrap failed: No such file or directory
error: open of class=padMid></td> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of width=30% failed: No such file or directory
error: open of align=left failed: No such file or directory
error: open of valign=bottom failed: No such file or directory
error: open of nowrap></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of </table> failed: No such file or directory
error: open of </div> failed: No such file or directory
error: open of <!-- failed: No such file or directory
error: open of Header failed: No such file or directory
error: open of END failed: No such file or directory
error: open of //--> failed: No such file or directory
error: open of <table failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of CELLPADDING=0 failed: No such file or directory
error: open of CELLSPACING=0 failed: No such file or directory
error: open of WIDTH=100%> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <TD><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT=></TD> failed: No such file or directory
error: open of <td><table failed: No such file or directory
error: open of width=100% failed: No such file or directory
error: open of border=0 failed: No such file or directory
error: open of cellspacing=0 failed: No such file or directory
error: open of cellpadding=0> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=15></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><h1>Sorry!</h1></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of colspan=2>In failed: No such file or directory
error: open of order failed: No such file or directory
error: open of to failed: No such file or directory
error: open of download failed: No such file or directory
error: open of products failed: No such file or directory
error: open of from failed: No such file or directory
error: open of Oracle failed: No such file or directory
error: open of Technology failed: No such file or directory
error: open of Network failed: No such file or directory
error: open of you failed: No such file or directory
error: open of must failed: No such file or directory
error: open of agree failed: No such file or directory
error: open of to failed: No such file or directory
error: open of the failed: No such file or directory
error: open of OTN failed: No such file or directory
error: open of license failed: No such file or directory
error: open of terms.</td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of colspan=2><strong>Be failed: No such file or directory
error: open of sure failed: No such file or directory
error: open of that...</strong></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><img failed: No such file or directory
error: open of alt= failed: No such file or directory
error: open of src=/errors/us/assets/004894.gif failed: No such file or directory
error: open of height=7 failed: No such file or directory
error: open of vspace=3> failed: No such file or directory
error: open of Your failed: No such file or directory
error: open of browser failed: No such file or directory
error: open of has failed: No such file or directory
error: open of cookies failed: No such file or directory
error: open of and failed: No such file or directory
error: open of JavaScript failed: No such file or directory
error: open of enabled.</td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of colspan=2><img failed: No such file or directory
error: open of alt= failed: No such file or directory
error: open of src=/errors/us/assets/004894.gif failed: No such file or directory
error: open of height=7 failed: No such file or directory
error: open of vspace=3> failed: No such file or directory
error: open of You failed: No such file or directory
error: open of clicked failed: No such file or directory
error: open of on failed: No such file or directory
error: open of Accept License failed: No such file or directory
error: open of for failed: No such file or directory
error: open of the failed: No such file or directory
error: open of product failed: No such file or directory
error: open of you failed: No such file or directory
error: open of wish failed: No such file or directory
error: open of to failed: No such file or directory
error: open of download.</td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of colspan=2><img failed: No such file or directory
error: open of alt= failed: No such file or directory
error: open of src=/errors/us/assets/004894.gif failed: No such file or directory
error: open of height=7 failed: No such file or directory
error: open of vspace=3> failed: No such file or directory
error: open of You failed: No such file or directory
error: open of attempt failed: No such file or directory
error: open of the failed: No such file or directory
error: open of download failed: No such file or directory
error: open of within failed: No such file or directory
error: open of 30 failed: No such file or directory
error: open of minutes failed: No such file or directory
error: open of of failed: No such file or directory
error: open of accepting failed: No such file or directory
error: open of the failed: No such file or directory
error: open of license.</td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of colspan=2><strong>From failed: No such file or directory
error: open of here failed: No such file or directory
error: open of you failed: No such file or directory
error: open of can failed: No such file or directory
error: open of go...</strong></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr> failed: No such file or directory
error: open of <td><IMG failed: No such file or directory
error: open of SRC=/errors/us/assets/spacer.gif failed: No such file or directory
error: open of BORDER=0 failed: No such file or directory
error: open of ALT= failed: No such file or directory
error: open of height=5></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of </table> failed: No such file or directory
error: open of <table failed: No such file or directory
error: open of width=100% failed: No such file or directory
error: open of border=0 failed: No such file or directory
error: open of align=center failed: No such file or directory
error: open of cellpadding=2 failed: No such file or directory
error: open of cellspacing=2> failed: No such file or directory
error: open of <tr failed: No such file or directory
error: open of valign=middle> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of align=right failed: No such file or directory
error: open of valign=top failed: No such file or directory
error: open of width=2%><img failed: No such file or directory
error: open of src=/errors/us/assets/004894.gif failed: No such file or directory
error: open of height=7 failed: No such file or directory
error: open of vspace=3></td> failed: No such file or directory
error: open of <td><a failed: No such file or directory
error: open of href=javascript:history.back(-1)>Back failed: No such file or directory
error: open of to failed: No such file or directory
error: open of Previous failed: No such file or directory
error: open of Page</a></td> failed: No such file or directory
error: open of </tr> failed: No such file or directory
error: open of <tr failed: No such file or directory
error: open of valign=middle> failed: No such file or directory
error: open of <td failed: No such file or directory
error: open of align=right failed: No such file or directory
error: open of valign=top><img failed: No such file or directory
error: open of src=/errors/us/assets/004894.gif failed: No such file or directory
error: open of height=7 failed: No such file or directory
error: open of vspace=3></td> failed: No such file or directory
error: open of <td><a failed: No such file or directory
error: open of href=http://www.oracle.com/us/sitemaps/index.html </tr> <tr valign=middle> <td align=right valign=top><img src=/errors/us/assets/004894.gif height=7 vspace=3></td> <td><a href=http://www.oracle.com/technetwork/index.html>OTN Homepage</a></td> </tr> </table> <br> <div id=footer> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td width=50% class=legalese align=right valign=top>&nbsp;</td> <td width=50% class=legalese align=left valign=top >&nbsp;</td> </tr> <tr> <td width=50% class=legalese align=left valign=top>&nbsp;</td> <td width=50% class=legalese align=right valign=top><a class=legalese href=http://www.oracle.com/rss/index.html target=_top>RSS <img src=/errors/us/assets/feed-icon-14x14.png width=14 height=14 border=0></A><span class=navlink> | </span> <a class=legalese href=http://www.oracle.com/html/copyright.html target=_top>Legal Notices and Terms for Use</a><span class=navlink> | </span> <a class=legalese href=http://www.oracle.com/html/privacy.html target=_top>Privacy Statement</a><br /> </td> </tr> <tr> <td width=50% class=legalese align=right valign=top>&nbsp;</td> <td width=50% class=legalese align=left valign=top ></td> </tr> </table> </div> </td> <TD WIDTH=10><IMG SRC=/errors/us/assets/spacer.gif BORDER=0 ALT= WIDTH=10></TD> </tr> </table> </body> </html> failed: No such file or directory

要回复文章请先登录注册