linux安裝java

OGG-01161發表於2015-09-18
linux安裝java
1.下載

從oracle網站下載java包
/>
Jdk-8u60-linux-x64.rpm

2. 安裝

chmod 755 jdk-8u60-linux-x64.rpm
rpm -ivh  jdk-8u60-linux-x64.rpm


[root@dgdb soft]# chmod 755 jdk-8u60-linux-x64.rpm
[root@dgdb soft]# ls -rtl
total 774056
-rw-r--r-- 1 root root 631758846 Sep 17 22:37 pdi-ce-5.4.0.1-130.zip
-rwxr-xr-x 1 root root 160084320 Sep 17 22:56 jdk-8u60-linux-x64.rpm

[root@dgdb soft]# rpm -ivh  jdk-8u60-linux-x64.rpm
Preparing...                ########################################### [100%]
   1:jdk1.8.0_60            ########################################### [100%]
Unpacking JAR files...
        tools.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...
        jfxrt.jar...
[root@dgdb soft]# 




3.檢視安裝結果

 which java
 whereis java
[root@dgdb soft]# which java
/usr/bin/java
[root@dgdb soft]# whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1
[root@dgdb soft]# 


4.配置
cd /root
vi .bash_profile
export JAVA_HOME=/usr/java
export JAVA_BIN=/usr/java/jdk1.8.0_60/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH

source .bash_profile

[root@dgdb /]# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
[root@dgdb /]# 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27571661/viewspace-1802957/,如需轉載,請註明出處,否則將追究法律責任。

相關文章