|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!概述
纪录CentOS装置JDK8的历程。
软件情况
CentOS:6.5,x86-64位版本
JDK:8.0,x86-64位版本,rpm格局
装置
起首切换到root:
```
su-root
```
然后装置jdk:
```
rpm-ivhjdk-8-linux-x64.rpm
Preparing...###########################################[100%]
1:jdk###########################################[100%]
UnpackingJARfiles...
rt.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/jre/lib/rt.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/jre/lib/rt.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
jsse.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/jre/lib/jsse.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/jre/lib/jsse.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
charsets.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/jre/lib/charsets.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/jre/lib/charsets.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
tools.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/lib/tools.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/lib/tools.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
localedata.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/jre/lib/ext/localedata.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/jre/lib/ext/localedata.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
jfxrt.jar...
Error:Couldnotopeninputfile:/usr/java/jdk1.8.0/jre/lib/ext/jfxrt.pack
Error:unpackcouldnotcreateJARfile:
/usr/java/jdk1.8.0/jre/lib/ext/jfxrt.jar
PleaserefertotheTroubleshootingsectionoftheInstallationInstructions
onthedownloadpage.
```
呈现下面的毛病是由于体系中已有JDK的其他版本,利用`rpm-qa|grepjdk`查询存在的jdk,并用`rpm-e`下令移除。以后再次实行装置,顺遂经由过程
```
Preparing...###########################################[100%]
1:jdk###########################################[100%]
UnpackingJARfiles...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
```
设置情况变量
编纂情况变量,设置path和classpath。vi/etc/profile,增添上面设置:
```
exportJAVA_HOME=/usr/java/jdk1.8.0/
exportCLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
exportPATH=$PATH:$JAVA_HOME/bin
```
保留加入后,实行`source/etc/profile`使变动失效。
检测装置的是不是准确,在shell中实行`java-version`和`javac-version`,假如shell显现以下的信息,暗示装置乐成:
```
[root@localhostDownloads]#java-version
javaversion"1.8.0"
Java(TM)SERuntimeEnvironment(build1.8.0-b132)
JavaHotSpot(TM)64-BitServerVM(build25.0-b70,mixedmode)
[root@localhostDownloads]#javac-version
javac1.8.0
```
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|