linux安装JDK

 

jdk的下载:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
➜  src rpm -ivh jdk-8u101-linux-x64.rpm 

 

➜  /usr ls
bin  games    java  lib64    local  share  tmp
etc  include  lib   libexec  sbin   src
➜  /usr pwd
/usr
➜  java rpm -qa|grep jdk 
jdk1.8.0_101-1.8.0_101-fcs.x86_64
➜  java ls
default  jdk1.8.0_101  latest
➜  java java -version 
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

写个小编序,来测试:

➜  ~ cat Hello.java 
public class Hello {
    public static void main(String[] args)
    {
        System.out.println("Hello");    
    }
}

编译:

➜  ~ javac Hello.java 

执行:

➜  ~ java Hello
Hello

测试成功!!!

卸载JDK:(并没有测试)

➜  ~ rpm -qa|grep jdk
jdk1.8.0_101-1.8.0_101-fcs.x86_64
➜  ~ rpm -e --nodeps jdk1.8.0_101-1.8.0_101-fcs.x86_64

 

posted @ 2016-09-04 09:23  bass  阅读(286)  评论(0编辑  收藏  举报